diff options
Diffstat (limited to 'resource')
-rw-r--r-- | resource/Makefile | 4 | ||||
-rw-r--r-- | resource/bits/types/struct_rusage.h | 130 | ||||
-rw-r--r-- | resource/getpriority.c | 2 | ||||
-rw-r--r-- | resource/getrlimit.c | 2 | ||||
-rw-r--r-- | resource/getrlimit64.c | 2 | ||||
-rw-r--r-- | resource/getrusage.c | 2 | ||||
-rw-r--r-- | resource/nice.c | 2 | ||||
-rw-r--r-- | resource/setpriority.c | 2 | ||||
-rw-r--r-- | resource/setrlimit.c | 3 | ||||
-rw-r--r-- | resource/setrlimit64.c | 2 | ||||
-rw-r--r-- | resource/sys/resource.h | 2 | ||||
-rw-r--r-- | resource/sys/vlimit.h | 2 | ||||
-rw-r--r-- | resource/sys/vtimes.h | 2 | ||||
-rw-r--r-- | resource/tst-getrlimit.c | 17 | ||||
-rw-r--r-- | resource/ulimit.c | 2 | ||||
-rw-r--r-- | resource/ulimit.h | 2 | ||||
-rw-r--r-- | resource/vlimit.c | 2 | ||||
-rw-r--r-- | resource/vtimes.c | 2 |
18 files changed, 165 insertions, 17 deletions
diff --git a/resource/Makefile b/resource/Makefile index 3aaadfde6e..bf66294ac3 100644 --- a/resource/Makefile +++ b/resource/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 1991-2016 Free Software Foundation, Inc. +# Copyright (C) 1991-2018 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 @@ -20,7 +20,7 @@ subdir := resource include ../Makeconfig headers := sys/resource.h bits/resource.h sys/vlimit.h sys/vtimes.h \ - ulimit.h + ulimit.h bits/types/struct_rusage.h routines := getrlimit setrlimit getrlimit64 setrlimit64 getrusage ulimit \ vlimit vtimes getpriority setpriority nice diff --git a/resource/bits/types/struct_rusage.h b/resource/bits/types/struct_rusage.h new file mode 100644 index 0000000000..5dc0916aa7 --- /dev/null +++ b/resource/bits/types/struct_rusage.h @@ -0,0 +1,130 @@ +/* Define struct rusage. + Copyright (C) 1994-2018 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 Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef __rusage_defined +#define __rusage_defined 1 + +#include <bits/types.h> +#include <bits/types/struct_timeval.h> + +/* Structure which says how much of each resource has been used. */ + +/* The purpose of all the unions is to have the kernel-compatible layout + while keeping the API type as 'long int', and among machines where + __syscall_slong_t is not 'long int', this only does the right thing + for little-endian ones, like x32. */ +struct rusage + { + /* Total amount of user time used. */ + struct timeval ru_utime; + /* Total amount of system time used. */ + struct timeval ru_stime; + /* Maximum resident set size (in kilobytes). */ + __extension__ union + { + long int ru_maxrss; + __syscall_slong_t __ru_maxrss_word; + }; + /* Amount of sharing of text segment memory + with other processes (kilobyte-seconds). */ + /* Maximum resident set size (in kilobytes). */ + __extension__ union + { + long int ru_ixrss; + __syscall_slong_t __ru_ixrss_word; + }; + /* Amount of data segment memory used (kilobyte-seconds). */ + __extension__ union + { + long int ru_idrss; + __syscall_slong_t __ru_idrss_word; + }; + /* Amount of stack memory used (kilobyte-seconds). */ + __extension__ union + { + long int ru_isrss; + __syscall_slong_t __ru_isrss_word; + }; + /* Number of soft page faults (i.e. those serviced by reclaiming + a page from the list of pages awaiting reallocation. */ + __extension__ union + { + long int ru_minflt; + __syscall_slong_t __ru_minflt_word; + }; + /* Number of hard page faults (i.e. those that required I/O). */ + __extension__ union + { + long int ru_majflt; + __syscall_slong_t __ru_majflt_word; + }; + /* Number of times a process was swapped out of physical memory. */ + __extension__ union + { + long int ru_nswap; + __syscall_slong_t __ru_nswap_word; + }; + /* Number of input operations via the file system. Note: This + and `ru_oublock' do not include operations with the cache. */ + __extension__ union + { + long int ru_inblock; + __syscall_slong_t __ru_inblock_word; + }; + /* Number of output operations via the file system. */ + __extension__ union + { + long int ru_oublock; + __syscall_slong_t __ru_oublock_word; + }; + /* Number of IPC messages sent. */ + __extension__ union + { + long int ru_msgsnd; + __syscall_slong_t __ru_msgsnd_word; + }; + /* Number of IPC messages received. */ + __extension__ union + { + long int ru_msgrcv; + __syscall_slong_t __ru_msgrcv_word; + }; + /* Number of signals delivered. */ + __extension__ union + { + long int ru_nsignals; + __syscall_slong_t __ru_nsignals_word; + }; + /* Number of voluntary context switches, i.e. because the process + gave up the process before it had to (usually to wait for some + resource to be available). */ + __extension__ union + { + long int ru_nvcsw; + __syscall_slong_t __ru_nvcsw_word; + }; + /* Number of involuntary context switches, i.e. a higher priority process + became runnable or the current process used up its time slice. */ + __extension__ union + { + long int ru_nivcsw; + __syscall_slong_t __ru_nivcsw_word; + }; + }; + +#endif diff --git a/resource/getpriority.c b/resource/getpriority.c index 379fef9db7..fb3930d3a3 100644 --- a/resource/getpriority.c +++ b/resource/getpriority.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2016 Free Software Foundation, Inc. +/* Copyright (C) 1991-2018 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 diff --git a/resource/getrlimit.c b/resource/getrlimit.c index 4d3e058f55..12faa7505d 100644 --- a/resource/getrlimit.c +++ b/resource/getrlimit.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2016 Free Software Foundation, Inc. +/* Copyright (C) 1991-2018 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 diff --git a/resource/getrlimit64.c b/resource/getrlimit64.c index 769046b91d..955032fae4 100644 --- a/resource/getrlimit64.c +++ b/resource/getrlimit64.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2016 Free Software Foundation, Inc. +/* Copyright (C) 1991-2018 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 diff --git a/resource/getrusage.c b/resource/getrusage.c index 0db1e6f675..c8f45845fe 100644 --- a/resource/getrusage.c +++ b/resource/getrusage.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2016 Free Software Foundation, Inc. +/* Copyright (C) 1991-2018 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 diff --git a/resource/nice.c b/resource/nice.c index 64b2c57398..b247e66615 100644 --- a/resource/nice.c +++ b/resource/nice.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1992-2016 Free Software Foundation, Inc. +/* Copyright (C) 1992-2018 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 diff --git a/resource/setpriority.c b/resource/setpriority.c index 49c29b139a..a63202fec5 100644 --- a/resource/setpriority.c +++ b/resource/setpriority.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2016 Free Software Foundation, Inc. +/* Copyright (C) 1991-2018 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 diff --git a/resource/setrlimit.c b/resource/setrlimit.c index a6ddcc4d61..5841302dda 100644 --- a/resource/setrlimit.c +++ b/resource/setrlimit.c @@ -1,5 +1,5 @@ /* Set process resource limits. Stub version. - Copyright (C) 1991-2016 Free Software Foundation, Inc. + Copyright (C) 1991-2018 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 @@ -29,6 +29,7 @@ __setrlimit (enum __rlimit_resource resource, const struct rlimit *rlimits) __set_errno (ENOSYS); return -1; } +libc_hidden_def (__setrlimit) weak_alias (__setrlimit, setrlimit) stub_warning (setrlimit) diff --git a/resource/setrlimit64.c b/resource/setrlimit64.c index 8e6ec2b60d..b83e10302d 100644 --- a/resource/setrlimit64.c +++ b/resource/setrlimit64.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2016 Free Software Foundation, Inc. +/* Copyright (C) 1991-2018 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 diff --git a/resource/sys/resource.h b/resource/sys/resource.h index dfef7ac17b..881db3970c 100644 --- a/resource/sys/resource.h +++ b/resource/sys/resource.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1992-2016 Free Software Foundation, Inc. +/* Copyright (C) 1992-2018 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 diff --git a/resource/sys/vlimit.h b/resource/sys/vlimit.h index d21b42dc63..8b1d24dd01 100644 --- a/resource/sys/vlimit.h +++ b/resource/sys/vlimit.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2016 Free Software Foundation, Inc. +/* Copyright (C) 1991-2018 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 diff --git a/resource/sys/vtimes.h b/resource/sys/vtimes.h index c6af2bad8d..cb4b7fec86 100644 --- a/resource/sys/vtimes.h +++ b/resource/sys/vtimes.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2016 Free Software Foundation, Inc. +/* Copyright (C) 1991-2018 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 diff --git a/resource/tst-getrlimit.c b/resource/tst-getrlimit.c index 67480340f0..fb95a28a68 100644 --- a/resource/tst-getrlimit.c +++ b/resource/tst-getrlimit.c @@ -1,3 +1,20 @@ +/* Copyright (C) 2005-2018 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 Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + #include <errno.h> #include <stdbool.h> #include <stdio.h> diff --git a/resource/ulimit.c b/resource/ulimit.c index 6e017fa883..e78dc593ae 100644 --- a/resource/ulimit.c +++ b/resource/ulimit.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2016 Free Software Foundation, Inc. +/* Copyright (C) 1991-2018 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 diff --git a/resource/ulimit.h b/resource/ulimit.h index aefc1b9f6b..554914cb73 100644 --- a/resource/ulimit.h +++ b/resource/ulimit.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1997-2016 Free Software Foundation, Inc. +/* Copyright (C) 1997-2018 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 diff --git a/resource/vlimit.c b/resource/vlimit.c index d817eeabbe..2523d17dc1 100644 --- a/resource/vlimit.c +++ b/resource/vlimit.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2016 Free Software Foundation, Inc. +/* Copyright (C) 1991-2018 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 diff --git a/resource/vtimes.c b/resource/vtimes.c index 40d03ff459..f2387143b6 100644 --- a/resource/vtimes.c +++ b/resource/vtimes.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2016 Free Software Foundation, Inc. +/* Copyright (C) 1991-2018 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 |