~serge-hallyn/ubuntu/raring/libvirt/libvirt-hugepages

« back to all changes in this revision

Viewing changes to gnulib/lib/unistd.in.h

  • Committer: James Westby
  • Author(s): Jamie Strandboge
  • Date: 2009-12-02 14:22:21 UTC
  • mfrom: (1.2.3 upstream) (3.4.9 squeeze)
  • Revision ID: james.westby@canonical.com-20091202142221-ltkr0to6h52mla1y
Tags: 0.7.2-4ubuntu1
* Merge from debian testing. Remaining changes:
  - debian/control:
    + Don't build-depend on QEmu
    + Bump bridge-utils, dnsmasq-base, netcat-openbsd, and iptables
      to Depends of libvirt-bin
    + Recommends qemu-kvm (>= 0.11.0-0ubuntu6)
    + Add versioned Conflicts/Replaces to libvirt0 for libvirt0-dbg,
      since we used to ship them as such
    + We call libxen-dev libxen3-dev, so change all references
    + Build-Depends on libxml2-utils
    + Build-Depends on open-iscsi-utils instead of open-iscsi due to
      LP: #414986
  - debian/postinst:
    + rename the libvirt group to libvirtd
    + add each admin user to the libvirtd group
  - debian/libvirt-bin.postrm: rename the libvirt group to libvirtd
  - debian/rules: add DEB_MAKE_CHECK_TARGET := check
  - debian/patches/900[0-7]: updated/refreshed for new paths in 0.7.2
  - debian/patches/series: don't apply 0002-qemu-disable-network.diff.patch
  - AppArmor integration:
    + debian/control: Build-Depends on libapparmor-dev and Suggests
      apparmor (>= 2.3+1289-0ubuntu14)
    + debian/libvirt-bin.dirs: add /etc/apparmor.d/abstractions,
      /etc/apparmor.d/force-complain, /etc/apparmor.d/libvirt,
      /etc/cron.daily and /usr/share/apport/package-hooks
    + add debian/libvirt-bin.cron.daily (LP: #438165)
    + add debian/libvirt-bin.apport
    + debian/libvirt-bin.install: install apparmor profiles, abstractions
      and apport hook
    + debian/postinst: reload apparmor profiles
    + debian/libvirt-bin.postrm: remove apparmor symlinks on purge
    + debian/libvirt-bin.preinst: added to force complain on certain
      upgrades
    + debian/README.Debian: add AppArmor section based on the upstream
      documentation
    + debian/rules: use --with-apparmor and copy apparmor and apport hook to
      debian/tmp
  - Dropped the following patches now included upstream:
    + 0005-Close-logfile-fd-after-spawning-qemu.patch
    + 9090-reenable-nonfile-labels.patch
    + 9091-apparmor.patch
    + 9092-apparmor-autoreconf.patch
* AppArmor integration updates:
  - debian/apparmor/usr.sbin.libvirtd: allow libvirtd access to
    /usr/lib/libvirt/* (LP: #480478)
  - debian/apparmor/libvirt-qemu: allow guests access to
    /etc/pki/libvirt-vnc/** (LP: #484562)
  - debian/libvirt-bin.postinst: 0.7.2 moved /usr/bin/virt-aa-helper to
    /usr/lib/libvirt, so the profile changed from usr.bin.virt-aa-helper
    to usr.lib.libvirt.virt-aa-helper and needs to be migrated. If the user
    made no changes to the old profile, remove it, otherwise, update the
    paths, preserving the shipped usr.lib.libvirt.virt-aa-helper
  - update to 0.7.4 version of the sVirt AppArmor driver (can be dropped in
    0.7.4):
    + debian/patches/9008-apparmor-caps-mockup.patch
    + debian/patches/9009-apparmor-lp453335.patch
    + debian/patches/9010-apparmor-lp460271.patch
    + debian/patches/9011-apparmor-code-cleanups.patch
  - add virt-aa-helper-test and examples/apparmor that were omitted from the
    upstream tarball (can be dropped in 0.7.5):
    + debian/patches/9012-apparmor-add-virt-aa-helper-test.patch
    + debian/patches/9013-apparmor-examples.patch
    + debian/rules: add post-patches target to make virt-aa-helper-test
      executable
* debian/patches/0005-Fix-SELinux-linking-issues.patch: updated to work
  when both apparmor and selinux are available. This patch should be
  dropped in 0.7.4.
* debian/patches/9007-default-config-test-case.patch: updated to not fail
  if building in a deep directory
* debian/patches/9014-event-fuzz.patch: add a little fuzz to not be quite
  so precise with expected expiry time. Fixes FTBFS with HZ=100 kernels.
  Can be dropped in 0.7.5.
* debian/patches/9015-hal-startup-failure-is-nonfatal.patch: disable hal
  driver if hald is not running instead of dying. Can be dropped in
  0.7.4.
* debian/control: temporarily remove Build-Depends on libcap-ng-dev, which
  isn't available in Ubuntu main yet
* revert change to new source format 3.0 (quilt) since Launchpad can't
  handle it yet (see LP: #293106)

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#ifndef _GL_UNISTD_H
30
30
#define _GL_UNISTD_H
31
31
 
 
32
/* NetBSD 5.0 mis-defines NULL.  Also get size_t.  */
 
33
#include <stddef.h>
 
34
 
32
35
/* mingw doesn't define the SEEK_* or *_FILENO macros in <unistd.h>.  */
33
36
#if !(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET)
34
37
# include <stdio.h>
43
46
# include <sys/types.h>
44
47
#endif
45
48
 
 
49
/* Get getopt(), optarg, optind, opterr, optopt.  */
 
50
#if @GNULIB_UNISTD_H_GETOPT@
 
51
# include <getopt.h>
 
52
#endif
 
53
 
46
54
#if @GNULIB_GETHOSTNAME@
47
55
/* Get all possible declarations of gethostname().  */
48
56
# if @UNISTD_H_HAVE_WINSOCK2_H@
98
106
# define STDERR_FILENO 2
99
107
#endif
100
108
 
 
109
/* Ensure *_OK functions exist.  */
 
110
#ifndef F_OK
 
111
# define F_OK 0
 
112
# define X_OK 1
 
113
# define W_OK 2
 
114
# define R_OK 4
 
115
#endif
 
116
 
 
117
 
101
118
/* Declare overridden functions.  */
102
119
 
103
120
#ifdef __cplusplus
130
147
#endif
131
148
 
132
149
 
 
150
#if @GNULIB_FCHOWNAT@
 
151
# if @REPLACE_FCHOWNAT@
 
152
#  undef fchownat
 
153
#  define fchownat rpl_fchownat
 
154
# endif
 
155
# if !@HAVE_FCHOWNAT@ || @REPLACE_FCHOWNAT@
 
156
extern int fchownat (int fd, char const *file, uid_t owner, gid_t group, int flag);
 
157
# endif
 
158
#elif defined GNULIB_POSIXCHECK
 
159
# undef fchownat
 
160
# define fchownat(d,n,o,g,f)                        \
 
161
    (GL_LINK_WARNING ("fchownat is not portable - " \
 
162
                      "use gnulib module openat for portability"), \
 
163
     fchownat (d, n, o, g, f))
 
164
#endif
 
165
 
 
166
 
 
167
#if @GNULIB_UNLINKAT@
 
168
# if !@HAVE_UNLINKAT@
 
169
extern int unlinkat (int fd, char const *file, int flag);
 
170
# endif
 
171
#elif defined GNULIB_POSIXCHECK
 
172
# undef unlinkat
 
173
# define unlinkat(d,n,f)                         \
 
174
    (GL_LINK_WARNING ("unlinkat is not portable - " \
 
175
                      "use gnulib module openat for portability"), \
 
176
     unlinkat (d, n, f))
 
177
#endif
 
178
 
 
179
 
 
180
#if @GNULIB_FACCESSAT@
 
181
# if !@HAVE_FACCESSAT@
 
182
int faccessat (int fd, char const *file, int mode, int flag);
 
183
# endif
 
184
#elif defined GNULIB_POSIXCHECK
 
185
# undef faccessat
 
186
# define faccessat(d,n,m,f)                         \
 
187
    (GL_LINK_WARNING ("faccessat is not portable - " \
 
188
                      "use gnulib module faccessat for portability"), \
 
189
     faccessat (d, n, m, f))
 
190
#endif
 
191
 
 
192
#if @GNULIB_SYMLINKAT@
 
193
# if !@HAVE_SYMLINKAT@
 
194
int symlinkat (char const *contents, int fd, char const *file);
 
195
# endif
 
196
#elif defined GNULIB_POSIXCHECK
 
197
# undef symlinkat
 
198
# define symlinkat(c,d,n)                            \
 
199
    (GL_LINK_WARNING ("symlinkat is not portable - " \
 
200
                      "use gnulib module symlinkat for portability"), \
 
201
     symlinkat (c, d, n))
 
202
#endif
 
203
 
 
204
#if @GNULIB_READLINKAT@
 
205
# if !@HAVE_READLINKAT@
 
206
ssize_t readlinkat (int fd, char const *file, char *buf, size_t len);
 
207
# endif
 
208
#elif defined GNULIB_POSIXCHECK
 
209
# undef readlinkat
 
210
# define readlinkat(d,n,b,l)                         \
 
211
    (GL_LINK_WARNING ("readlinkat is not portable - " \
 
212
                      "use gnulib module symlinkat for portability"), \
 
213
     readlinkat (d, n, b, l))
 
214
#endif
 
215
 
133
216
#if @GNULIB_CLOSE@
134
217
# if @REPLACE_CLOSE@
135
218
/* Automatically included by modules that need a replacement for close.  */
137
220
#  define close rpl_close
138
221
extern int close (int);
139
222
# endif
140
 
#elif @UNISTD_H_HAVE_WINSOCK2_H@
 
223
#elif @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
141
224
# undef close
142
225
# define close close_used_without_requesting_gnulib_module_close
143
226
#elif defined GNULIB_POSIXCHECK
150
233
 
151
234
 
152
235
#if @GNULIB_DUP2@
153
 
# if !@HAVE_DUP2@
 
236
# if @REPLACE_DUP2@
 
237
#  define dup2 rpl_dup2
 
238
# endif
 
239
# if !@HAVE_DUP2@ || @REPLACE_DUP2@
154
240
/* Copy the file descriptor OLDFD into file descriptor NEWFD.  Do nothing if
155
241
   NEWFD = OLDFD, otherwise close NEWFD first if it is open.
156
 
   Return 0 if successful, otherwise -1 and errno set.
 
242
   Return newfd if successful, otherwise -1 and errno set.
157
243
   See the POSIX:2001 specification
158
244
   <http://www.opengroup.org/susv3xsh/dup2.html>.  */
159
245
extern int dup2 (int oldfd, int newfd);
167
253
#endif
168
254
 
169
255
 
 
256
#if @GNULIB_DUP3@
 
257
/* Copy the file descriptor OLDFD into file descriptor NEWFD, with the
 
258
   specified flags.
 
259
   The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
 
260
   and O_TEXT, O_BINARY (defined in "binary-io.h").
 
261
   Close NEWFD first if it is open.
 
262
   Return newfd if successful, otherwise -1 and errno set.
 
263
   See the Linux man page at
 
264
   <http://www.kernel.org/doc/man-pages/online/pages/man2/dup3.2.html>.  */
 
265
# if @HAVE_DUP3@
 
266
#  define dup3 rpl_dup3
 
267
# endif
 
268
extern int dup3 (int oldfd, int newfd, int flags);
 
269
#elif defined GNULIB_POSIXCHECK
 
270
# undef dup3
 
271
# define dup3(o,n,f) \
 
272
    (GL_LINK_WARNING ("dup3 is unportable - " \
 
273
                      "use gnulib module dup3 for portability"), \
 
274
     dup3 (o, n, f))
 
275
#endif
 
276
 
 
277
 
170
278
#if @GNULIB_ENVIRON@
171
279
# if !@HAVE_DECL_ENVIRON@
172
280
/* Set of environment variables and values.  An array of strings of the form
214
322
 
215
323
#  define dup rpl_dup
216
324
extern int dup (int);
217
 
#  define dup2 rpl_dup2
218
 
extern int dup2 (int, int);
 
325
 
 
326
/* Gnulib internal hooks needed to maintain the fchdir metadata.  */
 
327
extern int _gl_register_fd (int fd, const char *filename);
 
328
extern void _gl_unregister_fd (int fd);
 
329
extern int _gl_register_dup (int oldfd, int newfd);
 
330
extern const char *_gl_directory_name (int fd);
219
331
 
220
332
# endif
221
333
#elif defined GNULIB_POSIXCHECK
313
425
 
314
426
#if @GNULIB_GETDTABLESIZE@
315
427
# if !@HAVE_GETDTABLESIZE@
316
 
/* Return the maximum number of file descriptors in the current process.  */
 
428
/* Return the maximum number of file descriptors in the current process.
 
429
   In POSIX, this is same as sysconf (_SC_OPEN_MAX).  */
317
430
extern int getdtablesize (void);
318
431
# endif
319
432
#elif defined GNULIB_POSIXCHECK
363
476
   See <http://www.opengroup.org/susv3xsh/getlogin.html>.
364
477
 */
365
478
# if !@HAVE_DECL_GETLOGIN_R@
366
 
#  include <stddef.h>
367
479
extern int getlogin_r (char *name, size_t size);
368
480
# endif
369
481
#elif defined GNULIB_POSIXCHECK
517
629
#endif
518
630
 
519
631
 
 
632
#if @GNULIB_PIPE2@
 
633
/* Create a pipe, applying the given flags when opening the read-end of the
 
634
   pipe and the write-end of the pipe.
 
635
   The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
 
636
   and O_TEXT, O_BINARY (defined in "binary-io.h").
 
637
   Store the read-end as fd[0] and the write-end as fd[1].
 
638
   Return 0 upon success, or -1 with errno set upon failure.
 
639
   See also the Linux man page at
 
640
   <http://www.kernel.org/doc/man-pages/online/pages/man2/pipe2.2.html>.  */
 
641
# if @HAVE_PIPE2@
 
642
#  define pipe2 rpl_pipe2
 
643
# endif
 
644
extern int pipe2 (int fd[2], int flags);
 
645
#elif defined GNULIB_POSIXCHECK
 
646
# undef pipe2
 
647
# define pipe2(f,o) \
 
648
    (GL_LINK_WARNING ("pipe2 is unportable - " \
 
649
                      "use gnulib module pipe2 for portability"), \
 
650
     pipe2 (f, o))
 
651
#endif
 
652
 
 
653
 
520
654
#if @GNULIB_READLINK@
521
655
/* Read the contents of the symbolic link FILE and place the first BUFSIZE
522
656
   bytes of it into BUF.  Return the number of bytes placed into BUF if
524
658
   See the POSIX:2001 specification
525
659
   <http://www.opengroup.org/susv3xsh/readlink.html>.  */
526
660
# if !@HAVE_READLINK@
527
 
#  include <stddef.h>
528
661
extern int readlink (const char *file, char *buf, size_t bufsize);
529
662
# endif
530
663
#elif defined GNULIB_POSIXCHECK
563
696
#endif
564
697
 
565
698
 
566
 
#ifdef FCHDIR_REPLACEMENT
567
 
/* gnulib internal function.  */
568
 
extern void _gl_unregister_fd (int fd);
569
 
#endif
570
 
 
571
 
 
572
699
#ifdef __cplusplus
573
700
}
574
701
#endif