Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tarot
gnulib
Commits
b23a8463
Commit
b23a8463
authored
Aug 24, 2009
by
Bruno Haible
Browse files
Tolerate declared but missing pipe2 syscall.
parent
c794f071
Changes
5
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
b23a8463
2009-08-23 Bruno Haible <bruno@clisp.org>
Tolerate declared but missing pipe2 syscall.
* lib/pipe2.c (pipe2): Invoke original pipe2 function first, if
available.
* lib/unistd.in.h (pipe2): If the function is already present,
override it.
* m4/pipe2.m4 (gl_FUNC_PIPE2): Remove AC_LIBOBJ invocation.
* modules/pipe2 (Makefile.am): Compile pipe2.c always.
Reported by Paolo Bonzini.
2009-08-23 Bruno Haible <bruno@clisp.org>
* lib/pipe2.c (pipe2): Move #ifs inside function.
lib/pipe2.c
View file @
b23a8463
...
...
@@ -40,6 +40,17 @@
int
pipe2
(
int
fd
[
2
],
int
flags
)
{
#if HAVE_PIPE2
# undef pipe2
/* Try the system call first, if it exists. (We may be running with a glibc
that has the function but with an older kernel that lacks it.) */
{
int
result
=
pipe2
(
fd
,
flags
);
if
(
!
(
result
<
0
&&
errno
==
ENOSYS
))
return
result
;
}
#endif
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
/* Native Woe32 API. */
...
...
lib/unistd.in.h
View file @
b23a8463
...
...
@@ -562,9 +562,10 @@ extern int link (const char *path1, const char *path2);
Return 0 upon success, or -1 with errno set upon failure.
See also the Linux man page at
<http://www.kernel.org/doc/man-pages/online/pages/man2/pipe2.2.html>. */
# if
!
@HAVE_PIPE2@
extern
in
t
pipe2
(
int
fd
[
2
],
int
flags
);
# if @HAVE_PIPE2@
# def
in
e
pipe2
rpl_pipe2
# endif
extern
int
pipe2
(
int
fd
[
2
],
int
flags
);
#elif defined GNULIB_POSIXCHECK
# undef pipe2
# define pipe2(f,o) \
...
...
m4/pipe2.m4
View file @
b23a8463
# pipe2.m4 serial
1
# pipe2.m4 serial
2
dnl Copyright (C) 2009 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
...
...
@@ -14,6 +14,5 @@ AC_DEFUN([gl_FUNC_PIPE2],
AC_CHECK_FUNCS_ONCE([pipe2])
if test $ac_cv_func_pipe2 != yes; then
HAVE_PIPE2=0
AC_LIBOBJ([pipe2])
fi
])
modules/pipe2
View file @
b23a8463
...
...
@@ -15,6 +15,7 @@ gl_FUNC_PIPE2
gl_UNISTD_MODULE_INDICATOR([pipe2])
Makefile.am:
lib_SOURCES += pipe2.c
Include:
<unistd.h>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment