1
0
mirror of https://git.savannah.gnu.org/git/gnulib.git synced 2025-08-10 04:43:00 +03:00
Files
gnulib/examples/hello-c-gnulib/hello.c
Bruno Haible a3c4f3ffbe Add simple examples.
* examples: New directory.
2021-12-15 19:59:01 +01:00

27 lines
534 B
C

/* This file is in the public domain.
Source code of the C program. */
/* Every source file that uses Gnulib needs this. */
#include <config.h>
/* Get printf() declaration. */
#include <stdio.h>
/* Get getpid() declaration. */
#include <unistd.h>
/* Include Gnulib header files. */
#include "get_ppid_of.h"
int
main ()
{
printf ("%s\n", "Hello, world!");
printf ("This program is running as process number %d.\n", getpid ());
printf ("The parent process number is %d.\n", get_ppid_of (getpid ()));
return 0;
}