public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/2] syscalls/setrlimit02.c: Add a test for EFAULT
@ 2017-10-04  5:51 Xiao Yang
  2017-10-04  5:52 ` [LTP] [PATCH 2/2] syscalls/setrlimit03.c: Cleanup && Convert to new API Xiao Yang
  2017-10-09 14:23 ` [LTP] [PATCH 1/2] syscalls/setrlimit02.c: Add a test for EFAULT Cyril Hrubis
  0 siblings, 2 replies; 14+ messages in thread
From: Xiao Yang @ 2017-10-04  5:51 UTC (permalink / raw)
  To: ltp

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
 testcases/kernel/syscalls/setrlimit/setrlimit02.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/testcases/kernel/syscalls/setrlimit/setrlimit02.c b/testcases/kernel/syscalls/setrlimit/setrlimit02.c
index 633279c..abcf2bc 100644
--- a/testcases/kernel/syscalls/setrlimit/setrlimit02.c
+++ b/testcases/kernel/syscalls/setrlimit/setrlimit02.c
@@ -18,7 +18,11 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 /*
- * Testcase to test the different errnos set by setrlimit(2) system call.
+ * DESCRIPTION
+ *  1) Test for EINVAL when resource is invalid.
+ *  2) Test for EFAULT when rlim points outside the accessible address space.
+ *  3) Test for EPERM when an unprivileged process tried to use setrlimit() to
+ *     increase a soft or hard limit.
  */
 #include <pwd.h>
 #include <errno.h>
@@ -33,6 +37,7 @@ static struct tcase {
 	int exp_errno;
 } tcases[] = {
 	{-1, &rlim, EINVAL},
+	{RLIMIT_NOFILE, (void *) -1, EFAULT},
 	{RLIMIT_NOFILE, &rlim, EPERM}
 };
 
-- 
1.8.3.1




^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2017-10-26  8:31 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-04  5:51 [LTP] [PATCH 1/2] syscalls/setrlimit02.c: Add a test for EFAULT Xiao Yang
2017-10-04  5:52 ` [LTP] [PATCH 2/2] syscalls/setrlimit03.c: Cleanup && Convert to new API Xiao Yang
2017-10-09 14:23 ` [LTP] [PATCH 1/2] syscalls/setrlimit02.c: Add a test for EFAULT Cyril Hrubis
2017-10-10  1:52   ` [LTP] [PATCH v2 " Xiao Yang
2017-10-10  1:52     ` [LTP] [PATCH v2 2/2] syscalls/setrlimit03.c: Cleanup && Convert to new API Xiao Yang
2017-10-19  5:12       ` Xiao Yang
2017-10-26  8:31       ` Cyril Hrubis
2017-10-10 12:55     ` [LTP] [PATCH v2 1/2] syscalls/setrlimit02.c: Add a test for EFAULT Cyril Hrubis
2017-10-11  4:43       ` [LTP] [PATCH v3 1/2] syscalls/setrlimit05.c: " Xiao Yang
2017-10-11 11:46         ` Cyril Hrubis
2017-10-11 12:26           ` [LTP] [PATCH v4 " Xiao Yang
2017-10-12 14:15             ` Cyril Hrubis
2017-10-16 10:30               ` [LTP] [PATCH v5 " Xiao Yang
2017-10-18 15:07                 ` Cyril Hrubis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox