stdlib

stdlib - Copyright(C 1991-2007 2009 Free Software...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
/* Copyright (C) 1991-2007, 2009 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ /* * ISO C99 Standard: 7.20 General utilities <stdlib.h> */ #ifndef _STDLIB_H #include <features.h> /* Get size_t, wchar_t and NULL from <stddef.h>. */ #define __need_size_t #ifndef __need_malloc_and_calloc # define __need_wchar_t # define __need_NULL #endif #include <stddef.h> __BEGIN_DECLS #ifndef __need_malloc_and_calloc #define _STDLIB_H 1 /* XPG requires a few symbols from <sys/wait.h> being defined. */ # include <bits/waitflags.h> # include <bits/waitstatus.h> # ifdef __USE_BSD /* Lots of hair to allow traditional BSD use of `union wait' as well as POSIX.1 use of `int' for the status word. */ # # define __WAIT_INT(status) \ (__extension__ (((union { __typeof(status) __in; int __i; }) \ { .__in = (status) }).__i)) # else # # endif /* This is the type of the argument to `wait'. The funky union causes redeclarations with ether `int *' or `union wait *' to be
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
allowed without complaint. __WAIT_STATUS_DEFN is the type used in the actual function definitions. */ # if !defined __GNUC__ || __GNUC__ < 2 || defined __cplusplus # define __WAIT_STATUS void * # define __WAIT_STATUS_DEFN void * # else /* This works in GCC 2.6.1 and later. */ typedef union { union wait *__uptr; int *__iptr; } __WAIT_STATUS __attribute__ ((__transparent_union__)); # define __WAIT_STATUS_DEFN int * # endif # else /* Don't use BSD. */ # define __WAIT_INT(status) (status) # define __WAIT_STATUS int * # define __WAIT_STATUS_DEFN int * # endif /* Use BSD. */ /* Define the macros <sys/wait.h> also would define this way. */ # define WEXITSTATUS(status) __WEXITSTATUS(__WAIT_INT(status)) # define WTERMSIG(status) __WTERMSIG(__WAIT_INT(status)) # define WSTOPSIG(status) __WSTOPSIG(__WAIT_INT(status)) # define WIFEXITED(status) __WIFEXITED(__WAIT_INT(status)) # define WIFSIGNALED(status) __WIFSIGNALED(__WAIT_INT(status)) # define WIFSTOPPED(status) __WIFSTOPPED(__WAIT_INT(status)) # ifdef __WIFCONTINUED # define WIFCONTINUED(status) __WIFCONTINUED(__WAIT_INT(status)) # endif #endif /* X/Open and <sys/wait.h> not included. */ __BEGIN_NAMESPACE_STD /* Returned by `div'. */ typedef struct
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/09/2010 for the course CS 152 taught by Professor Staff during the Spring '98 term at UCLA.

Page1 / 16

stdlib - Copyright(C 1991-2007 2009 Free Software...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online