diff options
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/posix/fpathconf.c | 20 | ||||
-rw-r--r-- | sysdeps/posix/pathconf.c | 20 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c | 2 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h | 41 |
4 files changed, 60 insertions, 23 deletions
diff --git a/sysdeps/posix/fpathconf.c b/sysdeps/posix/fpathconf.c index 1a2c374..31e1d4b 100644 --- a/sysdeps/posix/fpathconf.c +++ b/sysdeps/posix/fpathconf.c @@ -45,7 +45,6 @@ __fpathconf (fd, name) #ifdef LINK_MAX return LINK_MAX; #else - __set_errno (ENOSYS); return -1; #endif @@ -53,7 +52,6 @@ __fpathconf (fd, name) #ifdef MAX_CANON return MAX_CANON; #else - __set_errno (ENOSYS); return -1; #endif @@ -61,7 +59,6 @@ __fpathconf (fd, name) #ifdef MAX_INPUT return MAX_INPUT; #else - __set_errno (ENOSYS); return -1; #endif @@ -69,14 +66,21 @@ __fpathconf (fd, name) #ifdef NAME_MAX { struct statfs buf; + int save_errno = errno; if (__fstatfs (fd, &buf) < 0) - return errno == ENOSYS ? NAME_MAX : -1; + { + if (errno == ENOSYS) + { + errno = save_errno; + return NAME_MAX; + } + return -1; + } else return buf.f_namelen; } #else - __set_errno (ENOSYS); return -1; #endif @@ -84,7 +88,6 @@ __fpathconf (fd, name) #ifdef PATH_MAX return PATH_MAX; #else - __set_errno (ENOSYS); return -1; #endif @@ -92,7 +95,6 @@ __fpathconf (fd, name) #ifdef PIPE_BUF return PIPE_BUF; #else - __set_errno (ENOSYS); return -1; #endif @@ -142,13 +144,9 @@ __fpathconf (fd, name) #ifdef SOCK_MAXBUF return SOCK_MAXBUF; #else - __set_errno (ENOSYS); return -1; #endif } - - __set_errno (ENOSYS); - return -1; } weak_alias (__fpathconf, fpathconf) diff --git a/sysdeps/posix/pathconf.c b/sysdeps/posix/pathconf.c index c069066..fe2ac8d 100644 --- a/sysdeps/posix/pathconf.c +++ b/sysdeps/posix/pathconf.c @@ -43,7 +43,6 @@ __pathconf (const char *path, int name) #ifdef LINK_MAX return LINK_MAX; #else - __set_errno (ENOSYS); return -1; #endif @@ -51,7 +50,6 @@ __pathconf (const char *path, int name) #ifdef MAX_CANON return MAX_CANON; #else - __set_errno (ENOSYS); return -1; #endif @@ -59,7 +57,6 @@ __pathconf (const char *path, int name) #ifdef MAX_INPUT return MAX_INPUT; #else - __set_errno (ENOSYS); return -1; #endif @@ -67,14 +64,21 @@ __pathconf (const char *path, int name) #ifdef NAME_MAX { struct statfs buf; + int save_errno = errno; if (__statfs (path, &buf) < 0) - return errno == ENOSYS ? NAME_MAX : -1; + { + if (errno == ENOSYS) + { + errno = save_errno; + return NAME_MAX; + } + return -1; + } else return buf.f_namelen; } #else - __set_errno (ENOSYS); return -1; #endif @@ -82,7 +86,6 @@ __pathconf (const char *path, int name) #ifdef PATH_MAX return PATH_MAX; #else - __set_errno (ENOSYS); return -1; #endif @@ -90,7 +93,6 @@ __pathconf (const char *path, int name) #ifdef PIPE_BUF return PIPE_BUF; #else - __set_errno (ENOSYS); return -1; #endif @@ -140,13 +142,9 @@ __pathconf (const char *path, int name) #ifdef SOCK_MAXBUF return SOCK_MAXBUF; #else - __set_errno (ENOSYS); return -1; #endif } - - __set_errno (ENOSYS); - return -1; } weak_alias (__pathconf, pathconf) diff --git a/sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c b/sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c index a6655bf..58dac5f 100644 --- a/sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c +++ b/sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c @@ -42,8 +42,8 @@ vector will have to be laid out to allow for this \ test :-(. */ \ if (((ElfW(auxv_t) *)_test)->a_type <= AT_PHDR) \ + (auxp) = (ElfW(auxv_t) *) _tmp; \ } \ - (auxp) = (ElfW(auxv_t) *) _tmp; \ } while (0) diff --git a/sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h b/sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h new file mode 100644 index 0000000..09ab317 --- /dev/null +++ b/sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h @@ -0,0 +1,41 @@ +/* Copyright (C) 1997, 1998 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 Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _SYS_UCONTEXT_H +#define _SYS_UCONTEXT_H 1 + +#include <features.h> +#include <signal.h> + +/* We need the signal context definitions even if they are not used + included in <signal.h>. */ +#include <bits/sigcontext.h> + +typedef struct sigcontext mcontext_t; + +/* Userlevel context. */ +typedef struct ucontext + { + unsigned long int uc_flags; + struct ucontext *uc_links; + stack_t uc_stack; + mcontext_t uc_mcontext; + __sigset_t uc_sigmask; + } ucontext_t; + +#endif /* sys/ucontext.h */ |