~ubuntu-branches/ubuntu/utopic/coreutils/utopic-proposed

« back to all changes in this revision

Viewing changes to lib/unistd.in.h

  • Committer: Colin Watson
  • Date: 2013-10-30 15:48:33 UTC
  • mfrom: (8.3.5 sid)
  • Revision ID: cjwatson@canonical.com-20131030154833-xdt6e1yfffqom1c4
merge from Debian 8.21-1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* Substitute for and wrapper around <unistd.h>.
2
 
   Copyright (C) 2003-2012 Free Software Foundation, Inc.
 
2
   Copyright (C) 2003-2013 Free Software Foundation, Inc.
3
3
 
4
4
   This program is free software; you can redistribute it and/or modify
5
5
   it under the terms of the GNU General Public License as published by
14
14
   You should have received a copy of the GNU General Public License
15
15
   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
16
16
 
 
17
#ifndef _@GUARD_PREFIX@_UNISTD_H
 
18
 
17
19
#if __GNUC__ >= 3
18
20
@PRAGMA_SYSTEM_HEADER@
19
21
#endif
20
22
@PRAGMA_COLUMNS@
21
23
 
22
 
/* Special invocation convention:
23
 
   - On mingw, several headers, including <winsock2.h>, include <unistd.h>,
24
 
     but we need to ensure that both the system <unistd.h> and <winsock2.h>
25
 
     are completely included before we replace gethostname.  */
26
 
#if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@ \
27
 
  && !defined _GL_WINSOCK2_H_WITNESS && defined _WINSOCK2_H
28
 
/* <unistd.h> is being indirectly included for the first time from
29
 
   <winsock2.h>; avoid declaring any overrides.  */
30
 
# if @HAVE_UNISTD_H@
31
 
#  @INCLUDE_NEXT@ @NEXT_UNISTD_H@
32
 
# else
33
 
#  error unexpected; report this to bug-gnulib@gnu.org
34
 
# endif
35
 
# define _GL_WINSOCK2_H_WITNESS
36
 
 
37
 
/* Normal invocation.  */
38
 
#elif !defined _@GUARD_PREFIX@_UNISTD_H
39
 
 
40
24
/* The include_next requires a split double-inclusion guard.  */
41
25
#if @HAVE_UNISTD_H@
42
26
# @INCLUDE_NEXT@ @NEXT_UNISTD_H@
79
63
/* Solaris declares getcwd not only in <unistd.h> but also in <stdlib.h>.  */
80
64
/* But avoid namespace pollution on glibc systems.  */
81
65
#ifndef __GLIBC__
 
66
# define __need_system_stdlib_h
82
67
# include <stdlib.h>
 
68
# undef __need_system_stdlib_h
83
69
#endif
84
70
 
85
71
/* Native Windows platforms declare chdir, getcwd, rmdir in
127
113
# include <getopt.h>
128
114
#endif
129
115
 
 
116
_GL_INLINE_HEADER_BEGIN
 
117
#ifndef _GL_UNISTD_INLINE
 
118
# define _GL_UNISTD_INLINE _GL_INLINE
 
119
#endif
 
120
 
130
121
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
131
122
 
132
123
/* The definition of _GL_ARG_NONNULL is copied here.  */
404
395
# endif
405
396
#elif defined GNULIB_POSIXCHECK
406
397
# if HAVE_RAW_DECL_ENVIRON
407
 
static inline char ***
 
398
_GL_UNISTD_INLINE char ***
408
399
rpl_environ (void)
409
400
{
410
401
  return &environ;
862
853
#     define getpagesize() _gl_getpagesize ()
863
854
#    else
864
855
#     if !GNULIB_defined_getpagesize_function
865
 
static inline int
 
856
_GL_UNISTD_INLINE int
866
857
getpagesize ()
867
858
{
868
859
  return _gl_getpagesize ();
1530
1521
_GL_CXXALIASWARN (write);
1531
1522
#endif
1532
1523
 
 
1524
_GL_INLINE_HEADER_END
1533
1525
 
1534
1526
#endif /* _@GUARD_PREFIX@_UNISTD_H */
1535
1527
#endif /* _@GUARD_PREFIX@_UNISTD_H */