ugly but working
This commit is contained in:
24
Call_the_C/first-try.c
Normal file
24
Call_the_C/first-try.c
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* first try of a C func called from Fortran
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
/* --------------------------------------------------------------- */
|
||||
void first_try_(void)
|
||||
{
|
||||
fprintf(stderr, " pid=%u file='%s' func='%s' \n",
|
||||
(long)getpid(), __FILE__, __func__);
|
||||
}
|
||||
/* --------------------------------------------------------------- */
|
||||
long give_me_my_pid_ (void)
|
||||
{
|
||||
pid_t my_pid;
|
||||
|
||||
my_pid = (long)getpid();
|
||||
fprintf(stderr, " %s -> %d\n", __func__, my_pid);
|
||||
|
||||
return my_pid;
|
||||
}
|
||||
/* --------------------------------------------------------------- */
|
||||
Reference in New Issue
Block a user