mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
Update.
2004-03-28 Ulrich Drepper <drepper@redhat.com> * sysdeps/unix/sysv/linux/sysconf.c (__sysconf): Handle _SC_SIGQUEUE_MAX.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2004-03-28 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* sysdeps/unix/sysv/linux/sysconf.c (__sysconf): Handle
|
||||||
|
_SC_SIGQUEUE_MAX.
|
||||||
|
|
||||||
2004-03-26 Ulrich Drepper <drepper@redhat.com>
|
2004-03-26 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
* elf/dl-caller.c: New file.
|
* elf/dl-caller.c: New file.
|
||||||
|
@ -32,6 +32,8 @@ static long int posix_sysconf (int name);
|
|||||||
long int
|
long int
|
||||||
__sysconf (int name)
|
__sysconf (int name)
|
||||||
{
|
{
|
||||||
|
const char *procfname = NULL;
|
||||||
|
|
||||||
switch (name)
|
switch (name)
|
||||||
{
|
{
|
||||||
#ifdef __NR_clock_getres
|
#ifdef __NR_clock_getres
|
||||||
@ -47,37 +49,44 @@ __sysconf (int name)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
case _SC_NGROUPS_MAX:
|
case _SC_NGROUPS_MAX:
|
||||||
{
|
/* Try to read the information from the /proc/sys/kernel/ngroups_max
|
||||||
/* Try to read the information from the /proc/sys/kernel/ngroups_max
|
file. */
|
||||||
file. */
|
procfname = "/proc/sys/kernel/ngroups_max";
|
||||||
int fd = open_not_cancel_2 ("/proc/sys/kernel/ngroups_max", O_RDONLY);
|
break;
|
||||||
if (fd != -1)
|
|
||||||
{
|
|
||||||
/* This is more than enough, the file contains a single
|
|
||||||
integer. */
|
|
||||||
char buf[32];
|
|
||||||
ssize_t n;
|
|
||||||
n = TEMP_FAILURE_RETRY (read_not_cancel (fd, buf,
|
|
||||||
sizeof (buf) - 1));
|
|
||||||
close_not_cancel_no_status (fd);
|
|
||||||
|
|
||||||
if (n > 0)
|
case _SC_SIGQUEUE_MAX:
|
||||||
{
|
/* The /proc/sys/kernel/rtsig-max file contains the answer. */
|
||||||
/* Terminate the string. */
|
procfname = "/proc/sys/kernel/rtsig-max";
|
||||||
buf[n] = '\0';
|
|
||||||
|
|
||||||
char *endp;
|
|
||||||
long int res = strtol (buf, &endp, 10);
|
|
||||||
if (endp != buf && (*endp == '\0' || *endp == '\n'))
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (procfname != NULL)
|
||||||
|
{
|
||||||
|
int fd = open_not_cancel_2 (procfname, O_RDONLY);
|
||||||
|
if (fd != -1)
|
||||||
|
{
|
||||||
|
/* This is more than enough, the file contains a single integer. */
|
||||||
|
char buf[32];
|
||||||
|
ssize_t n;
|
||||||
|
n = TEMP_FAILURE_RETRY (read_not_cancel (fd, buf, sizeof (buf) - 1));
|
||||||
|
close_not_cancel_no_status (fd);
|
||||||
|
|
||||||
|
if (n > 0)
|
||||||
|
{
|
||||||
|
/* Terminate the string. */
|
||||||
|
buf[n] = '\0';
|
||||||
|
|
||||||
|
char *endp;
|
||||||
|
long int res = strtol (buf, &endp, 10);
|
||||||
|
if (endp != buf && (*endp == '\0' || *endp == '\n'))
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return posix_sysconf (name);
|
return posix_sysconf (name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user