cat ttt.c
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <fcntl.h>
/* Conform man getpgid trebuiesc definite XOPEN_SOURCE_EXTENDED sau
_XOPEN_SOURCE 500
In /usr/include/unistd.h definitia lui getpgid
// Get the process group ID of process PID.
extern __pid_t __getpgid (__pid_t __pid) __THROW;
#ifdef __USE_XOPEN_EXTENDED
extern __pid_t getpgid (__pid_t __pid) __THROW;
#endif
*/
#define _XOPEN_SOURCE_EXTENDED
#define _XOPEN_SOURCE_500
#define __USE_XOPEN_EXTENDED
int
main(int argtc, char **argv)
{
int p=getpgid();
}
La compilare da avertismentul
$gcc -Wall ttt.c
ttt.c: In function 'main':
ttt.c:32: warning: implicit declaration of function 'getpgid'
ttt.c:32: warning: unused variable 'p'
# din man gcc
# -munix=93 provides the same predefines as GCC 3.3 and 3.4.
-munix=95 provides
# additional predefines for "XOPEN_UNIX" and "_XOPEN_SOURCE_EXTENDED", and
# the startfile unix95.o. -munix=98 provides additional predefines for
# "_XOPEN_UNIX", "_XOPEN_SOURCE_EXTENDED", "_INCLUDE__STDC_A1_SOURCE"
# and "_INCLUDE_XOPEN_SOURCE_500",and the startfile unix98.o.
$gcc -munix=98 -Wall ttt.c
cc1: error: unrecognized command line option "-munix=98"
$gcc -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v
--enable-languages=c,c++,java,fortran,objc,obj-c++,ada,treelang
--prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu
--enable-libstdcxx-debug --enable-java-awt=gtk --enable-gtk-cairo
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-4.1-1.4.2.0/jre
--enable-mpfr --with-tune=i686 --enable-checking=release
i486-linux-gnu
Thread model: posix
gcc version 4.1.2 20060613 (prerelease) (Debian 4.1.1-5)
_______________________________________________
RLUG mailing list
[email protected]
http://lists.lug.ro/mailman/listinfo/rlug