safe_macros: Add SAFE_GETRLIMIT and SAFE_SETRLIMIT

Signed-off-by: Zeng Linggang <zenglg.jy@cn.fujitsu.com>
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
mlock/mlock02.c: cleanup

* Delete some useless commtents.
* Use SAFE_* macros.
* Some cleanup.

Signed-off-by: Zeng Linggang <zenglg.jy@cn.fujitsu.com>
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
mlock/mlock02.c: add EPERM and ENOMEM errno tests

Add EPERM and ENOMEM errno tests for mlock(2).

Signed-off-by: Zeng Linggang <zenglg.jy@cn.fujitsu.com>
Reviewed-by: Jan Stancek <jstancek@redhat.com>
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
lstat/lstat02.c: add ELOOP errno test

Add ELOOP errno test for lstat(2)

Signed-off-by: Zeng Linggang <zenglg.jy@cn.fujitsu.com>
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
SAFE_MACROS: Add chmod() and fchmod()

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
syscalls/link: Cleanup.

* Cleanup excessive comments

* Make use of SAFE_MACROS()

* Check return values from all syscalls

* Removed obsolete CRAY specific test

* Add tst_require_root() to link06 and link07

* ...

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
msgctl11: cleanup and fflush removed

Performed some cleanup and removed fflush() from the
testcase.

fflush() before FORK_OR_VFORK() is not needed because of
commit 3f0510cb2d18720e294e89fbdb4ce38e0ede47d6

fflush() before exit() is redundant.

Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
msgctl11: process message queues by portions

/proc/sys/kernel/msgmni value scales with the amount of the host memory.

On systems with several tens gigabytes of ram this value is rather big (and
even may reach its limit - IPCMI (32768), defined in include/linux/ipc.h) and
therefore the test case fails with "Not enough free pids" error.

Now we process all avaliable message queues by portions (with the size based
on the amount of free pids).

Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
mkdirat/mkdirat02.c: add new error number tests

Add ELOOP and EROFS error number tests for mkdirat(2)

Signed-off-by: Zeng Linggang <zenglg.jy@cn.fujitsu.com>
lapi: Add mkdirat.h

Which defines mkdirat() if it's not present in system headers.

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
syscalls/mkdirat01: Fixes.

* Cleanup

* Use tst_exit() instead of return 0
  (the test failure wasn't propagated out at all!)

* Make use of tst_tmpdir()

* Fix test iterations with -i

* Fix dir permissions (fixes test failure)

  the positive testcase was failing because the test had not
  search permission on the directory pointed to by dirfd

* Use lapi/mkdirat.h

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
syscalls/mkdirat02: Use lapi/mkdirat.h

Make use of lapi/mkdirat.h, add comment.

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
connect01: fix fd leak

And also one old-style warning.

Signed-off-by: Jan Stancek <jstancek@redhat.com>
syscalls/swapoff: Further cleanup.

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
syscalls/swapoff01: Do not fail on Btrfs

Currently swapfiles on Btrfs are not supported and I've been told that
it's not likely to be implemented in the near future.

So if we are on Btrfs and we get EINVAL from swapon() we return TCONF.

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
syscalls/swapon: Further cleanup.

* Sort out included files

* Use safe macros

* etc

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
syscalls/swapon: Do not fail on Btrfs

Currently swapfiles on Btrfs are not supported and I've been told that
it's not likely to be implemented in the near future.

So if we are on Btrfs and we get EINVAL from swapon() we return TCONF.

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
Merge remote branch 'upstream/master'