(CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
[glibc.git] / nptl / sysdeps / unix / sysv / linux / i386 / not-cancel.h
blobcc3282fbdd402eb4b01bfb577b578d154f618bd8
1 /* Uncancelable versions of cancelable interfaces. Linux/NPTL version.
2 Copyright (C) 2003 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4 Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, write to the Free
18 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19 02111-1307 USA. */
21 #include <sysdep.h>
23 #if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
24 extern int __open_nocancel (const char *, int, ...) attribute_hidden;
25 extern int __close_nocancel (int) attribute_hidden;
26 extern int __read_nocancel (int, void *, size_t) attribute_hidden;
27 extern int __write_nocancel (int, const void *, size_t) attribute_hidden;
28 extern pid_t __waitpid_nocancel (pid_t, int *, int) attribute_hidden;
29 #else
30 #define __open_nocancel(name, ...) __open (name, __VA_ARGS__)
31 #define __close_nocancel(fd) __close (fd)
32 #define __read_nocancel(fd, buf, len) __read (fd, buf, len)
33 #define __write_nocancel(fd, buf, len) __write (fd, buf, len)
34 #define __waitpid_nocancel(pid, stat_loc, options) \
35 __waitpid (pid, stat_loc, options)
36 #endif
38 /* Uncancelable open. */
39 #define open_not_cancel(name, flags, mode) \
40 __open_nocancel (name, flags, mode)
41 #define open_not_cancel_2(name, flags) \
42 __open_nocancel (name, flags)
44 /* Uncancelable close. */
45 #define close_not_cancel(fd) \
46 __close_nocancel (fd)
47 #define close_not_cancel_no_status(fd) \
48 (void) ({ INTERNAL_SYSCALL_DECL (err); \
49 INTERNAL_SYSCALL (close, err, 1, (fd)); })
51 /* Uncancelable read. */
52 #define read_not_cancel(fd, buf, n) \
53 __read_nocancel (fd, buf, n)
55 /* Uncancelable write. */
56 #define write_not_cancel(fd, buf, n) \
57 __write_nocancel (fd, buf, n)
59 /* Uncancelable writev. */
60 #define writev_not_cancel_no_status(fd, iov, n) \
61 (void) ({ INTERNAL_SYSCALL_DECL (err); \
62 INTERNAL_SYSCALL (writev, err, 3, (fd), (iov), (n)); })
64 /* Uncancelable fcntl. */
65 #define fcntl_not_cancel(fd, cmd, val) \
66 __fcntl_nocancel (fd, cmd, val)
68 /* Uncancelable waitpid. */
69 #ifdef __NR_waitpid
70 # define waitpid_not_cancel(pid, stat_loc, options) \
71 __waitpid_nocancel (pid, stat_loc, options)
72 #else
73 # define waitpid_not_cancel(pid, stat_loc, options) \
74 INLINE_SYSCALL (wait4, 4, pid, stat_loc, options, NULL)
75 #endif