diff options
author | Joseph Myers <joseph@codesourcery.com> | 2015-06-17 20:22:39 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2015-06-17 20:22:39 +0000 |
commit | c36213513490412941512daccf447513e442651b (patch) | |
tree | d5be56d7d716470d892ca65d847c73165866a28b /resource | |
parent | abccad04b4172d552dbdae948c0e567ba266ad76 (diff) | |
download | glibc-c36213513490412941512daccf447513e442651b.tar glibc-c36213513490412941512daccf447513e442651b.tar.gz glibc-c36213513490412941512daccf447513e442651b.tar.bz2 glibc-c36213513490412941512daccf447513e442651b.zip |
Fix nice getpriority, setpriority namespace (bug 18553).
nice (XPG3) calls getpriority and setpriority (in XPG4 but not XPG3,
i.e. UX-shaded in XPG4). This patch fixes this by making those
functions into weak aliases of __* functions and calling the __*
versions as needed.
Tested for x86_64 and x86 (testsuite, and that disassembly of
installed shared libraries is unchanged by this patch).
This completes cleaning up the unsorted linknamespace test XFAILs.
[BZ #18553]
* resource/getpriority.c (getpriority): Rename to __getpriority
and define as weak alias of __getpriority.
* resource/setpriority.c (setpriority): Rename to __setpriority
and define as weak alias of __setpriority.
* sysdeps/mach/hurd/getpriority.c (getpriority): Rename to
__getpriority and define as weak alias of __getpriority.
* sysdeps/mach/hurd/setpriority.c (setpriority): Rename to
__setpriority and define as weak alias of __setpriority.
* sysdeps/unix/syscalls.list (getpriority): Use __getpriority as
strong name.
(setpriority): Use __setpriority as strong name.
* sysdeps/unix/sysv/linux/getpriority.c (getpriority): Rename to
__getpriority and define as weak alias of __getpriority.
* include/sys/resource.h (__getpriority): Declare. Use
libc_hidden_proto.
(__setpriority): Likewise.
(getpriority): Don't use libc_hidden_proto.
(setpriority): Likewise.
* sysdeps/posix/nice.c (nice): Call __getpriority instead of
getpriority. Call __setpriority instead of setpriority.
* conform/Makefile (test-xfail-XPG3/unistd.h/linknamespace):
Remove variable.
Diffstat (limited to 'resource')
-rw-r--r-- | resource/getpriority.c | 5 | ||||
-rw-r--r-- | resource/setpriority.c | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/resource/getpriority.c b/resource/getpriority.c index 88ec4dba0c..6df7294578 100644 --- a/resource/getpriority.c +++ b/resource/getpriority.c @@ -23,13 +23,14 @@ or user (as specified by WHO) is used. A lower priority number means higher priority. Priorities range from PRIO_MIN to PRIO_MAX. */ int -getpriority (which, who) +__getpriority (which, who) enum __priority_which which; id_t who; { __set_errno (ENOSYS); return -1; } -libc_hidden_def (getpriority) +libc_hidden_def (__getpriority) +weak_alias (__getpriority, getpriority) stub_warning (getpriority) diff --git a/resource/setpriority.c b/resource/setpriority.c index 08b0a95ea9..91521bdbb9 100644 --- a/resource/setpriority.c +++ b/resource/setpriority.c @@ -21,7 +21,7 @@ /* Set the priority of all processes specified by WHICH and WHO to PRIO. Returns 0 on success, -1 on errors. */ int -setpriority (which, who, prio) +__setpriority (which, who, prio) enum __priority_which which; id_t who; int prio; @@ -29,6 +29,7 @@ setpriority (which, who, prio) __set_errno (ENOSYS); return -1; } -libc_hidden_def (setpriority) +libc_hidden_def (__setpriority) +weak_alias (__setpriority, setpriority) stub_warning (setpriority) |