plateform
stringclasses
1 value
repo_name
stringclasses
2 values
name
stringlengths
1
78
ext
stringclasses
2 values
path
stringlengths
15
1.11k
size
int64
1
8.55M
source_encoding
stringclasses
11 values
md5
stringlengths
32
32
text
stringlengths
0
8.49M
google
android
signal04
.c
platform/external/ltp/testcases/kernel/syscalls/signal/signal04.c
1,120
utf_8
58a9ca0dc8b5ce144969ceab71afe456
*/ /*\ * [Description] * * Restore signals to default behavior. */ #include "signal.h" #include "tst_test.h" static int siglist[] = { SIGHUP, SIGINT, SIGQUIT, SIGILL, SIGTRAP, SIGABRT, SIGBUS, SIGFPE, SIGUSR1, SIGSEGV, SIGUSR2, SIGPIPE, SIGALRM, SIGTERM, SIGCHLD, SIGCONT, SIGTSTP, SIGTTIN, SIGTTOU, SIGURG, SIGX...
google
android
signal02
.c
platform/external/ltp/testcases/kernel/syscalls/signal/signal02.c
450
utf_8
3cfe69ab33e1355d6b55a62f1708a37a
*/ /*\ * [Description] * * Test that we get an error using illegal signals. */ #include "tst_test.h" static int sigs[] = { _NSIG + 1, SIGKILL, SIGSTOP }; static void do_test(unsigned int n) { TST_EXP_FAIL2((long)signal(sigs[n], SIG_IGN), EINVAL); } static struct tst_test test = { .tcnt = ARRAY_SIZE(sigs), .test...
google
android
getpgid01
.c
platform/external/ltp/testcases/kernel/syscalls/getpgid/getpgid01.c
3,459
utf_8
6180da9861eaaecb0541ab61964ae348
/* * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * NAME * getpgid01.c * * DESCRIPTION * Testcase to check the basic functionality of getpgid(). * * ALGORITHM * block1: Does getpgid(0), and checks for error. * block2: Does getpgid(getpid()) and checks for error. ...
google
android
getpgid02
.c
platform/external/ltp/testcases/kernel/syscalls/getpgid/getpgid02.c
3,017
utf_8
9799ec89e00853ea835007ee39bdd0b8
/* * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * NAME * getpgid02.c * * DESCRIPTION * Testcase to check the basic functionality of getpgid(). * * ALGORITHM * test 1: Does getpgid(-99) and expects ESRCH. * test 2: Searches an unused pid and expects ESRCH. * *...
google
android
io_setup01
.c
platform/external/ltp/testcases/kernel/syscalls/io_setup/io_setup01.c
2,446
utf_8
905af08d5ffa70bedf6c6041d00cc72f
*/ /*\ * [Description] * * Test io_setup invoked via libaio: * * - io_setup succeeds if both nr_events and ctxp are valid. * - io_setup fails and returns -EINVAL if ctxp is not initialized to 0. * - io_setup fails and returns -EINVAL if nr_events is invalid. * - io_setup fails and returns -EFAULT if ctxp is NU...
google
android
io_setup02
.c
platform/external/ltp/testcases/kernel/syscalls/io_setup/io_setup02.c
1,898
utf_8
ae489c3337340035b51df0eedfd35495
*/ /*\ * [Description] * * Test io_setup invoked via syscall(2): * * - io_setup fails and returns EFAULT if ctxp is NULL. * - io_setup fails and returns EINVAL if ctxp is not initialized to 0. * - io_setup fails and returns EINVAL if nr_events is -1. * - io_setup fails and returns EAGAIN if nr_events exceeds t...
google
android
gethostname01
.c
platform/external/ltp/testcases/kernel/syscalls/gethostname/gethostname01.c
3,883
utf_8
befdf6fffbc2e55335928ae7d5f2eeba
/* * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, * Mountain View, CA 94043, or: * * http://www.sgi.com * * For further information regarding this notice, see: * * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ * */ ...
google
android
sysfs03
.c
platform/external/ltp/testcases/kernel/syscalls/sysfs/sysfs03.c
549
utf_8
0a1bb81c0502f2b5d826294d34884c1d
*/ /*\ * [Description] * * This test is run for option 3 for sysfs(2). * Return the total number of filesystem types currently present in the kernel. */ #include <errno.h> #include <unistd.h> #include <sys/syscall.h> #include "tst_test.h" #include "lapi/syscalls.h" static void verify_sysfs03(void) { TST_EXP_POSI...
google
android
sysfs01
.c
platform/external/ltp/testcases/kernel/syscalls/sysfs/sysfs01.c
603
utf_8
19bb4c0a0a8f2e18312cad718f5d7edb
*/ /*\ * [Description] * * This test is run for option 1 for sysfs(2). * Translate the filesystem identifier string fsname into a filesystem type index. */ #include <errno.h> #include <unistd.h> #include <sys/syscall.h> #include "tst_test.h" #include "lapi/syscalls.h" static void verify_sysfs01(void) { /* option...
google
android
sysfs04
.c
platform/external/ltp/testcases/kernel/syscalls/sysfs/sysfs04.c
574
utf_8
048f8caf84c7114f505eb956cdea48d8
*/ /*\ * [Description] * * This test case checks whether sysfs(2) system call returns * appropriate error number for invalid option. */ #include <errno.h> #include <sys/syscall.h> #include "tst_test.h" #include "lapi/syscalls.h" #define INVALID_OPTION 100 static void verify_sysfs04(void) { TST_EXP_FAIL(tst_sysca...
google
android
sysfs02
.c
platform/external/ltp/testcases/kernel/syscalls/sysfs/sysfs02.c
721
utf_8
2570dce9dafe5ede1ff2f1bf70efa14e
*/ /*\ * [Description] * * This test is run for option 2 for sysfs(2). * Translate the filesystem type index fs_index into a null-terminated filesystem * identifier string. This string will be written to the buffer pointed to by buf. * Make sure that buf has enough space to accept the string. */ #include <errno...
google
android
sysfs05
.c
platform/external/ltp/testcases/kernel/syscalls/sysfs/sysfs05.c
1,377
utf_8
b0cd599e8ef5e5928480319f8678a2ab
*/ /*\ * [Description] * * This test case checks whether sysfs(2) system call returns appropriate * error number for invalid option and for invalid filesystem name and fs index out of bounds. */ #include "tst_test.h" #include "lapi/syscalls.h" static struct test_case { int option; char *fsname; int fsindex; c...
google
android
gethostbyname_r01
.c
platform/external/ltp/testcases/kernel/syscalls/gethostbyname_r/gethostbyname_r01.c
2,136
utf_8
4ca1f551198156d25238eb427fa2d292
/* */ /* * This is a test for glibc bug: * https://www.qualys.com/research/security-advisories/GHOST-CVE-2015-0235.txt */ #include <netdb.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <errno.h> #include "test.h" #define CANARY "in_the_coal_mine" static void setup(void); static void check_vu...
google
android
sigpending02
.c
platform/external/ltp/testcases/kernel/syscalls/sigpending/sigpending02.c
4,224
utf_8
8a309e98b8859384833718b6c53a4557
* * AUTHORS * Paul Larson * Matthias Maennich * * DESCRIPTION * Test 1: Suppress handling SIGUSR1 and SIGUSR1, raise them and assert their * signal pending. * Test 2: Call sigpending(sigset_t*=-1), it should return -1 with errno EFAULT. */ #include "config.h" #include "tst_test.h" #include "ltp_signal.h" #inc...
google
android
wait02
.c
platform/external/ltp/testcases/kernel/syscalls/wait/wait02.c
977
utf_8
2fc4285babc2cdc6a6dcd0c6c2545a07
* AUTHOR : William Roske * CO-PILOT : Dave Fenner */ /*\ * [Description] * * For a terminated child, test whether wait(2) can get its pid * and exit status correctly. */ #include <errno.h> #include <sys/types.h> #include <sys/wait.h> #include <stdlib.h> #include "tst_test.h" static void verify_wait(void...
google
android
wait01
.c
platform/external/ltp/testcases/kernel/syscalls/wait/wait01.c
474
utf_8
6af6cb3dc89e7b32a97d3acdbccf8503
*/ /*\ * [Description] * * Check that if the calling process does not have any unwaited-for children * wait() will return ECHILD. */ #include <sys/wait.h> #include <sys/types.h> #include "tst_test.h" static void verify_wait(void) { TST_EXP_FAIL(wait(NULL), ECHILD); } static struct tst_test test = { .test_all = ...
google
android
unshare02
.c
platform/external/ltp/testcases/kernel/syscalls/unshare/unshare02.c
1,340
utf_8
c9925b69b9010a285fb6b45f429a9198
*/ /*\ * [Description] * * Basic tests for the unshare(2) errors. * * - EINVAL on invalid flags * - EPERM when process is missing required privileges */ #define _GNU_SOURCE #include <stdio.h> #include <sys/wait.h> #include <sys/types.h> #include <sys/param.h> #include <sys/syscall.h> #include <sched.h> #include...
google
android
unshare01
.c
platform/external/ltp/testcases/kernel/syscalls/unshare/unshare01.c
1,108
utf_8
2ce3e62c13e3db1228116242d033395d
*/ /*\ * [Description] * * Basic tests for the unshare() syscall. * * [Algorithm] * * Calls unshare() for different CLONE_* flags in a child process and expects * them to succeed. */ #define _GNU_SOURCE #include <stdio.h> #include <sys/wait.h> #include <sys/types.h> #include <sys/param.h> #include <sys/syscal...
google
android
fchdir01
.c
platform/external/ltp/testcases/kernel/syscalls/fchdir/fchdir01.c
619
utf_8
a199934df72cdd5289022bdab6dde111
*/ /* * DESCRIPTION * fchdir01 - create a directory and cd into it. */ #include "tst_test.h" static int fd; static const char *TEST_DIR = "alpha"; #define MODES S_IRWXU static void verify_fchdir(void) { TST_EXP_PASS(fchdir(fd)); } static void setup(void) { SAFE_MKDIR(TEST_DIR, MODES); fd = SAFE_OPEN(TEST_DIR, O_...
google
android
fchdir02
.c
platform/external/ltp/testcases/kernel/syscalls/fchdir/fchdir02.c
381
utf_8
b18126d6307ce22246b9b4a9d648ea55
*/ /* * DESCRIPTION * fchdir02 - try to cd into a bad directory (bad fd). */ #include "tst_test.h" static void verify_fchdir(void) { const int bad_fd = -5; TST_EXP_FAIL(fchdir(bad_fd), EBADF); } static struct tst_test test = { .test_all = verify_fchdir, };
google
android
fchdir03
.c
platform/external/ltp/testcases/kernel/syscalls/fchdir/fchdir03.c
1,261
utf_8
6abbda87d056029d2f97c0aa5322e9b0
*/ /* * DESCRIPTION * Testcase for testing that fchdir(2) sets EACCES errno * * ALGORITHM * 1. create a child process, sets its uid to ltpuser1 * 2. this child creates a directory with perm 400, * 3. this child opens the directory and gets a file descriptor * 4. this child attempts to fchdir(2) to the director...
google
android
pipe01
.c
platform/external/ltp/testcases/kernel/syscalls/pipe/pipe01.c
991
utf_8
17aca53aeb344059bfac99b3d9abc652
*/ /* * Basic test for pipe(). */ #include <errno.h> #include <string.h> #include "tst_test.h" static int fds[2]; static void verify_pipe(void) { int rd_size, wr_size; char wrbuf[] = "abcdefghijklmnopqrstuvwxyz"; char rdbuf[128]; memset(rdbuf, 0, sizeof(rdbuf)); TEST(pipe(fds)); if (TST_RET == -1) { tst_res(...
google
android
pipe13
.c
platform/external/ltp/testcases/kernel/syscalls/pipe/pipe13.c
2,197
utf_8
26e099c323d626e4aa8dc2afdcf3a385
* * Test Description: * This case is designed to test whether pipe can wakeup all readers * when last writer closes. * * This is also a regression test for commit 6551d5c56eb0 * ("pipe: make sure to wake up everybody when the last reader/writer closes"). * This bug was introduced by commit 0ddad21d3e99 ("pipe: ...
google
android
pipe07
.c
platform/external/ltp/testcases/kernel/syscalls/pipe/pipe07.c
3,737
utf_8
b6da04c61eda6a85a9498b558396a5bd
/* * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * Test the ability of pipe to open the maximum even number of file * descriptors permitted (or (maxfds - 3)/2 pipes) * * ALGORITHM * 1. record file descriptors open prior to test run * 2. open pipes until EMFILE is ret...
google
android
pipe03
.c
platform/external/ltp/testcases/kernel/syscalls/pipe/pipe03.c
1,075
utf_8
254b214f7d06d5b632b83e37bf7afde3
*/ /* * Make sure that writing to the read end of a pipe and reading from * the write end of a pipe both fail. */ #include <unistd.h> #include <errno.h> #include "tst_test.h" static int fd[2]; static void verify_pipe(void) { char buf[2]; TEST(pipe(fd)); if (TST_RET == -1) { tst_res(TFAIL | TTERRNO, "pipe() fai...
google
android
pipe02
.c
platform/external/ltp/testcases/kernel/syscalls/pipe/pipe02.c
1,763
utf_8
6a760849f14769330340426ed9199deb
*/ /* * Check that if a child has a "broken pipe", this information * is transmitted to the waiting parent. */ #include <errno.h> #include <string.h> #include <unistd.h> #include <stdlib.h> #include <sys/wait.h> #include "tst_test.h" #define SIZE 5 static int fd[2]; static char rdbuf[SIZE]; static char wrbuf[SIZE];...
google
android
pipe06
.c
platform/external/ltp/testcases/kernel/syscalls/pipe/pipe06.c
2,636
utf_8
61815e0107bed253e5e87fb25ec19fea
/* * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * NAME * pipe06.c * * DESCRIPTION * Check what happens when the system runs out of pipes. * * ALGORITHM * Issue enough pipe calls to run the system out of pipes. * Check that we get EMFILE. * * USAGE: <for command...
google
android
pipe09
.c
platform/external/ltp/testcases/kernel/syscalls/pipe/pipe09.c
4,839
utf_8
c8ea6ce402dfca98f500a848ea5b5e62
/* * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * NAME * pipe09.c * * DESCRIPTION * Check that two processes can use the same pipe at the same time. * * ALGORITHM * 1. Open a pipe * 2. Fork a child which writes to the pipe * 3. Fork another child which writes a ...
google
android
pipe05
.c
platform/external/ltp/testcases/kernel/syscalls/pipe/pipe05.c
3,185
utf_8
00d7a7a5b077932d28a822ed4da95d5d
/* * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * NAME * pipe05.c * * DESCRIPTION * Check what happens when pipe is passed a bad file descriptor. * * ALGORITHM * Issue the pipe call with a bad file descriptor. * Check that we get EFAULT. * * USAGE: <for command...
google
android
pipe12
.c
platform/external/ltp/testcases/kernel/syscalls/pipe/pipe12.c
2,724
utf_8
7177db012f743720d0ea5ccd0bf2225c
* * Test Description: * A pipe has a limited capacity. If the pipe with non block mode is full, * then a write(2) will fail and get EAGAIN error. Otherwise, from 1 to * PIPE_BUF bytes may be written. */ #define _GNU_SOURCE #include <unistd.h> #include <stdlib.h> #include "tst_test.h" #include "lapi/fcntl.h" stati...
google
android
pipe08
.c
platform/external/ltp/testcases/kernel/syscalls/pipe/pipe08.c
3,169
utf_8
783cab5f9797fe4c955917799d47d637
/* * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * NAME * pipe08.c * * DESCRIPTION * Check that a SIGPIPE signal is generated when a write is * attempted on an empty pipe. * * ALGORITHM * 1. Write to a pipe after closing the read side. * 2. Check for the signal SI...
google
android
pipe11
.c
platform/external/ltp/testcases/kernel/syscalls/pipe/pipe11.c
2,017
utf_8
eeb0073e2b8fd5a0ab5f7b6a5100a6ce
*/ /* * Check if many children can read what is written to a pipe by the parent. * * ALGORITHM * For a different nchilds number: * 1. Open a pipe and write nchilds * (PIPE_BUF/nchilds) bytes into it * 2. Fork nchilds children * 3. Each child reads PIPE_BUF/nchilds characters and checks that the * bytes re...
google
android
pipe04
.c
platform/external/ltp/testcases/kernel/syscalls/pipe/pipe04.c
5,798
utf_8
628ae95ce6d12c4be0207b11424a440b
/* * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * NAME * pipe04.c * * DESCRIPTION * Check that processes are killable, even when they are still writing * data to a pipe. * * ALGORITHM * 1. Open a pipe * 2. fork a two children that will write to the pipe * 3...
google
android
pipe10
.c
platform/external/ltp/testcases/kernel/syscalls/pipe/pipe10.c
3,781
utf_8
fc51e6a21b1afa89052d435c903982f5
/* * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * NAME * pipe10.c * * DESCRIPTION * Check that parent can open a pipe and have a child read from it * * ALGORITHM * Parent opens pipe, child reads. Passes if child can read all the * characters written by the parent....
google
android
realpath01
.c
platform/external/ltp/testcases/kernel/syscalls/realpath/realpath01.c
1,066
utf_8
b05a5ef12b58e16059cc3651ba2d4b22
*/ #include "tst_test.h" #include <errno.h> #include <stdlib.h> #define CHROOT_DIR "cve-2018-1000001" static void setup(void) { SAFE_MKDIR(CHROOT_DIR, 0755); SAFE_CHROOT(CHROOT_DIR); } static void run(void) { TESTPTR(realpath(".", NULL)); if (TST_ERR != ENOENT) { tst_res(TFAIL | TTERRNO, "returned unexpected err...
google
android
fanotify06
.c
platform/external/ltp/testcases/kernel/syscalls/fanotify/fanotify06.c
6,211
utf_8
624751044f7c2b0d2776f71382e4ff10
* Date: Thu Nov 13 15:19:33 2014 -0800 * * fanotify: fix notification of groups with inode & mount marks * * The overlayfs test case is a regression test for: * * commit d989903058a83e8536cc7aadf9256a47d5c173fe * Date: Wed Apr 24 19:39:50 2019 +0300 * * ovl: do not generate duplicate fsnotify...
google
android
fanotify10
.c
platform/external/ltp/testcases/kernel/syscalls/fanotify/fanotify10.c
29,477
utf_8
c44923d560150b9d76d1c80460ea3ef5
*/ /*\ * [Description] * Check that fanotify properly merges ignore mask of a mount mark * with a mask of an inode mark on the same group. Unlike the * prototype test fanotify06, do not use FAN_MODIFY event for the * test mask, because it hides the bug. */ /* * This is a regression test for commit: * * 9...
google
android
fanotify17
.c
platform/external/ltp/testcases/kernel/syscalls/fanotify/fanotify17.c
6,991
utf_8
5073ac6b41a8c659e8b98640ccec4579
*/ /*\ * [Description] * Check that fanotify groups and marks limits are enforced correctly. * If user ns is supported, verify that global limit and per user ns * limits are both enforced. * Otherwise, we only check that global groups limit is enforced. */ #define _GNU_SOURCE #include "config.h" #include <errno....
google
android
fanotify02
.c
platform/external/ltp/testcases/kernel/syscalls/fanotify/fanotify02.c
4,423
utf_8
865840568a05bdd4a780659db9938573
*/ /*\ * [Description] * Check that fanotify work for children of a directory. */ #define _GNU_SOURCE #include "config.h" #include <stdio.h> #include <sys/stat.h> #include <sys/types.h> #include <errno.h> #include <string.h> #include <sys/syscall.h> #include "tst_test.h" #ifdef HAVE_SYS_FANOTIFY_H #include "fanotif...
google
android
fanotify14
.c
platform/external/ltp/testcases/kernel/syscalls/fanotify/fanotify14.c
8,497
utf_8
c86d41e6fa363e065eb6f3fcf6af4615
*/ /*\ * [Description] * This test file has been designed to ensure that the fanotify * system calls fanotify_init(2) and fanotify_mark(2) return the * correct error code to the calling process when an invalid flag or * mask value has been specified in conjunction with FAN_REPORT_FID. */ /* * The ENOTDIR test c...
google
android
fanotify11
.c
platform/external/ltp/testcases/kernel/syscalls/fanotify/fanotify11.c
2,575
utf_8
71c1ab96cbdc9752252f6619ebaca1c9
*/ /*\ * [Description] * After fanotify_init adds flags FAN_REPORT_TID, * check whether the program can accurately identify which thread id * in the multithreaded program triggered the event. */ #define _GNU_SOURCE #include "config.h" #include <stdio.h> #include <stdlib.h> #include <sys/stat.h> #include <sys/type...
google
android
fanotify19
.c
platform/external/ltp/testcases/kernel/syscalls/fanotify/fanotify19.c
6,476
utf_8
534a4bceae2cc54d2ee4ef2c9f460cfd
*/ /*\ * [Description] * This set of tests is to ensure that the unprivileged listener feature of * fanotify is functioning as expected. The objective of this test file is * to generate a sequence of events and ensure that the returned events * contain the limited values that an unprivileged listener is expected ...
google
android
fanotify_child
.c
platform/external/ltp/testcases/kernel/syscalls/fanotify/fanotify_child.c
286
utf_8
91fbe3b85ff77a6f1c16998186d1a259
* * DESCRIPTION * Simple helper program that can be invoked from fanotify tests. */ int main(void) { return 0; }
google
android
fanotify16
.c
platform/external/ltp/testcases/kernel/syscalls/fanotify/fanotify16.c
28,094
utf_8
e899489c7dc0f4cf681173f2d4333368
*/ /*\ * [Description] * Check fanotify directory entry modification events, events on child and * on self with group init flags: * * - FAN_REPORT_DFID_NAME (dir fid + name) * - FAN_REPORT_DIR_FID (dir fid) * - FAN_REPORT_DIR_FID | FAN_REPORT_FID (dir fid + child fid) * - FAN_REPORT_DFID_NAME | FAN_REPORT_...
google
android
fanotify08
.c
platform/external/ltp/testcases/kernel/syscalls/fanotify/fanotify08.c
1,280
utf_8
b47eb5973919b8bad77c3d446a01c391
*/ /*\ * [Description] * Sanity check fanotify_init flag FAN_CLOEXEC by fcntl. */ #define _GNU_SOURCE #include "config.h" #include <stdio.h> #include <sys/stat.h> #include <sys/types.h> #include <errno.h> #include <string.h> #include <sys/syscall.h> #include "tst_test.h" #ifdef HAVE_SYS_FANOTIFY_H #include "fanotif...
google
android
fanotify05
.c
platform/external/ltp/testcases/kernel/syscalls/fanotify/fanotify05.c
5,109
utf_8
dc09630ac3a683fddbb029b41eebb3fd
*/ /*\ * [Description] * Check that fanotify overflow event is properly generated. * * [Algorithm] * Generate enough events without reading them and check that overflow * event is generated. */ #define _GNU_SOURCE #include "config.h" #include <stdio.h> #include <sys/stat.h> #include <sys/types.h> #include <errn...
google
android
fanotify07
.c
platform/external/ltp/testcases/kernel/syscalls/fanotify/fanotify07.c
4,284
utf_8
9c3b445859b740e7b523119bc3ebcd9e
*/ /*\ * [Description] * Check that fanotify permission events are handled properly on instance destruction. */ /* * Kernel crashes should be fixed by: * 96d41019e3ac "fanotify: fix list corruption in fanotify_get_response()" * * Kernel hangs should be fixed by: * 05f0e38724e8 "fanotify: Release SRCU lock wh...
google
android
fanotify13
.c
platform/external/ltp/testcases/kernel/syscalls/fanotify/fanotify13.c
8,168
utf_8
7d7025d3b505da6267cf30847d43d832
*/ /*\ * [Description] * Validate that the values returned within an event when FAN_REPORT_FID is * specified matches those that are obtained via explicit invocation to system * calls statfs(2) and name_to_handle_at(2). */ /* * This is also regression test for: * c285a2f01d69 ("fanotify: update connector fs...
google
android
fanotify09
.c
platform/external/ltp/testcases/kernel/syscalls/fanotify/fanotify09.c
14,837
utf_8
4e40e8753dd433edb8bff4e42aa5d313
*/ /*\ * [Description] * Check that fanotify handles events on children correctly when both parent and * subdir or mountpoint marks exist. */ /* * This is a regression test for commit: * * 54a307ba8d3c fanotify: fix logic of events on child * * Test case #1 is a regression test for commit: * * b46...
google
android
fanotify21
.c
platform/external/ltp/testcases/kernel/syscalls/fanotify/fanotify21.c
7,514
utf_8
f04db32c382de575deb9100b55ddfa34
*/ /*\ * [Description] * * A test which verifies whether the returned struct * fanotify_event_info_pidfd in FAN_REPORT_PIDFD mode contains the * expected set of information. * * NOTE: FAN_REPORT_PIDFD support was added in v5.15-rc1 in af579beb666a * ("fanotify: add pidfd support to the fanotify API"). */ #def...
google
android
fanotify23
.c
platform/external/ltp/testcases/kernel/syscalls/fanotify/fanotify23.c
6,462
utf_8
30fc4b0f5e3124a064ec071d9dcd7095
*/ /*\ * [Description] * Check evictable fanotify inode marks. */ #define _GNU_SOURCE #include "config.h" #include <stdio.h> #include <sys/stat.h> #include <sys/types.h> #include <errno.h> #include <string.h> #include <sys/syscall.h> #include "tst_test.h" #ifdef HAVE_SYS_FANOTIFY_H #include "fanotify.h" #define EVE...
google
android
fanotify22
.c
platform/external/ltp/testcases/kernel/syscalls/fanotify/fanotify22.c
7,428
utf_8
39f6356d30b8615f12874c4d39f43989
*/ /*\ * [Description] * Check fanotify FAN_ERROR_FS events triggered by intentionally * corrupted filesystems: * * - Generate a broken filesystem * - Start FAN_FS_ERROR monitoring group * - Make the file system notice the error through ordinary operations * - Observe the event generated */ #define _GNU_SOURC...
google
android
fanotify03
.c
platform/external/ltp/testcases/kernel/syscalls/fanotify/fanotify03.c
8,191
utf_8
b295d70138390f275d4d9756b46b831f
*/ /*\ * [Description] * Check that fanotify permission events work. */ #define _GNU_SOURCE #include "config.h" #include <stdio.h> #include <unistd.h> #include <sys/stat.h> #include <sys/types.h> #include <sys/wait.h> #include <errno.h> #include <string.h> #include <signal.h> #include <sys/syscall.h> #include <stdl...
google
android
fanotify12
.c
platform/external/ltp/testcases/kernel/syscalls/fanotify/fanotify12.c
5,532
utf_8
9534e61e97d415b09dec29a716247e7f
*/ /*\ * [Description] * Validate that the newly introduced FAN_OPEN_EXEC mask functions as expected. * The idea is to generate a sequence of open related actions to ensure that * the correct event flags are being set depending on what event mask was * requested when the object was marked. */ #define _GNU_SOURCE...
google
android
fanotify20
.c
platform/external/ltp/testcases/kernel/syscalls/fanotify/fanotify20.c
2,036
utf_8
d57c83e3451d2f670dd3ac53ea336357
*/ /*\ * [Description] * * This source file contains a test case which ensures that the fanotify API * returns an expected error code when provided an invalid initialization flag * alongside FAN_REPORT_PIDFD. Additionally, it checks that the operability with * existing FAN_REPORT_* flags is maintained and functi...
google
android
fanotify01
.c
platform/external/ltp/testcases/kernel/syscalls/fanotify/fanotify01.c
8,782
utf_8
07ff33f86b777b5d1168af240b34c64e
*/ /*\ * [Description] * Check that fanotify work for a file. */ #define _GNU_SOURCE #include "config.h" #include <stdio.h> #include <sys/stat.h> #include <sys/types.h> #include <errno.h> #include <string.h> #include <sys/syscall.h> #include "tst_test.h" #ifdef HAVE_SYS_FANOTIFY_H #include "fanotify.h" #define EVEN...
google
android
fanotify04
.c
platform/external/ltp/testcases/kernel/syscalls/fanotify/fanotify04.c
5,147
utf_8
361d2ac3afb0665d9d732ec5a26bf979
*/ /*\ * [Description] * Check various fanotify special flags. */ #define _GNU_SOURCE #include "config.h" #include <stdio.h> #include <sys/stat.h> #include <sys/types.h> #include <errno.h> #include <string.h> #include <sys/syscall.h> #include "tst_test.h" #ifdef HAVE_SYS_FANOTIFY_H #include "fanotify.h" /* size of ...
google
android
fanotify15
.c
platform/external/ltp/testcases/kernel/syscalls/fanotify/fanotify15.c
8,536
utf_8
d1a1c678a8ca600388b21512a02fa125
*/ /*\ * [Description] * Test file that has been purposely designed to verify FAN_REPORT_FID * functionality while using newly defined dirent events. */ /* * Test case #1 is a regression test for commit f367a62a7cad: * fanotify: merge duplicate events on parent and child */ #define _GNU_SOURCE #include "co...
google
android
fanotify18
.c
platform/external/ltp/testcases/kernel/syscalls/fanotify/fanotify18.c
4,921
utf_8
6a06a10507183aae433eb0b58e962998
*/ /*\ * [Description] * This set of tests is to ensure that the unprivileged listener feature of * fanotify is functioning as expected. The objective this test case file * is to validate whether any forbidden flags that are passed by an * unprivileged user return the correct error result. */ #define _GNU_SOURCE...
google
android
rmdir02
.c
platform/external/ltp/testcases/kernel/syscalls/rmdir/rmdir02.c
2,628
utf_8
fa0e1c686c19f1f30da9a7c72458b741
* Ported to LTP: Wayne Boyer */ /* * Description: * 1) attempt to rmdir() non-empty directory -> ENOTEMPTY * 2) attempt to rmdir() directory with long path name -> ENAMETOOLONG * 3) attempt to rmdir() non-existing directory -> ENOENT * 4) attempt to rmdir() a file -> ENOTDIR * 5) attempt to rmdir() in...
google
android
rmdir01
.c
platform/external/ltp/testcases/kernel/syscalls/rmdir/rmdir01.c
823
utf_8
4286304ed68f5f64adbc961994bd94c1
*/ /* DESCRIPTION * This test will verify that rmdir(2) syscall basic functionality. * verify rmdir(2) returns a value of 0 and the directory being removed. */ #include <errno.h> #include <sys/stat.h> #include <sys/types.h> #include <unistd.h> #include "tst_test.h" #define TESTDIR "testdir" static void verify_r...
google
android
rmdir03
.c
platform/external/ltp/testcases/kernel/syscalls/rmdir/rmdir03.c
2,144
utf_8
63ec0aa68efef0e5092e8b035a346312
*/ /* * DESCRIPTION * check rmdir() fails with EPERM or EACCES * * 1. Create a directory tstdir1 and set the sticky bit, then * create directory tstdir2 under tstdir1. Call rmdir(), * set to be user nobody. Pass tstdir2 to rmdir(2), verify * the return value is not 0 and the errno is E...
google
android
getdents02
.c
platform/external/ltp/testcases/kernel/syscalls/getdents/getdents02.c
2,142
utf_8
d8f056481b010eff063c766326419e23
*/ /*\ * [Description] * * Verify that: * * - getdents() fails with EBADF if file descriptor fd is invalid * - getdents() fails with EINVAL if result buffer is too small * - getdents() fails with ENOTDIR if file descriptor does not refer to a directory * - getdents() fails with ENOENT if directory was ...
google
android
getdents01
.c
platform/external/ltp/testcases/kernel/syscalls/getdents/getdents01.c
3,262
utf_8
2e29edbf14cfff28807901d11925da46
*/ /*\ * * [Description] * * Basic getdents() test that checks if directory listing is correct and * complete. * */ #define _GNU_SOURCE #include "tst_test.h" #include "getdents.h" #include <stdlib.h> static void reset_flags(void); static void check_flags(void); static void set_flag(const char *name); static int...
google
android
recv01
.c
platform/external/ltp/testcases/kernel/syscalls/recv/recv01.c
7,361
utf_8
8189970906624332f2693dbf6e239b80
/* * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * Test Name: recv01 * * Test Description: * Verify that recv() returns the proper errno for various failure cases * * Usage: <for command-line> * recv01 [-c n] [-e] [-i n] [-I x] [-P x] [-t] * -e : Tu...
google
android
mprotect03
.c
platform/external/ltp/testcases/kernel/syscalls/mprotect/mprotect03.c
3,719
utf_8
3b7a959a1fb528418a50b86ba1527574
/* * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * NAME * mprotect03.c * * DESCRIPTION * Testcase to check the mprotect(2) system call. * * ALGORITHM * Create a shared mapped file region with PROT_READ | PROT_WRITE * using the mmap(2) call. Then, use mprotect(2) to disa...
google
android
mprotect01
.c
platform/external/ltp/testcases/kernel/syscalls/mprotect/mprotect01.c
3,799
utf_8
55c38524ff148e2b82515766e847aa26
/* * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * DESCRIPTION * Testcase to check the error conditions for mprotect(2) * * ALGORITHM * test1: * Invoke mprotect() with an address of 0. Check if error * is set to ENOMEM. * test2: * Invoke mprotect() with an address th...
google
android
mprotect02
.c
platform/external/ltp/testcases/kernel/syscalls/mprotect/mprotect02.c
4,015
utf_8
b3877330d7c61f9ab24d50d7651c187f
/* * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * DESCRIPTION * Testcase to check the mprotect(2) system call. * * ALGORITHM * Create a mapped region using mmap with READ permission. * Try to write into that region in a child process using memcpy. * Verify that a SIGSEGV...
google
android
mprotect04
.c
platform/external/ltp/testcases/kernel/syscalls/mprotect/mprotect04.c
6,686
utf_8
ee3d289a09612de9f54ad2a5daa3a1cb
/* * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ /* * Description: * Verify that, * 1) mprotect() succeeds to set a region of memory with no access, * when 'prot' is set to PROT_NONE. An attempt to access the contents * of the region gives rise to the signal SIGSEGV. * 2) mpro...
google
android
getxattr01
.c
platform/external/ltp/testcases/kernel/syscalls/getxattr/getxattr01.c
4,533
utf_8
5aae3664cc73e9b37109281c1f866afe
/* * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ /* * Basic tests for getxattr(2) and make sure getxattr(2) handles error * conditions correctly. * * There are 4 test cases: * 1. Get an non-existing attribute, * getxattr(2) should return -1 and set errno to ENODATA *...
google
android
getxattr05
.c
platform/external/ltp/testcases/kernel/syscalls/getxattr/getxattr05.c
4,079
utf_8
a33be467c2db477fa803a367e24aea06
*/ /* * Description: * 1) Witout a user namespace, getxattr(2) should get same data when * acquiring the value of system.posix_acl_access twice. * 2) With/Without mapped root UID in a user namespaces, getxattr(2) should * get same data when acquiring the value of system.posix_acl_access twice. * * This is...
google
android
getxattr02
.c
platform/external/ltp/testcases/kernel/syscalls/getxattr/getxattr02.c
4,228
utf_8
9a21b2df603a1197ca93d70790e40984
/* * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ /* * In the user.* namespace, only regular files and directories can * have extended attributes. Otherwise getxattr(2) will return -1 * and set errno to ENODATA. * * There are 4 test cases: * 1. Get attribute from a FIFO, ...
google
android
getxattr04
.c
platform/external/ltp/testcases/kernel/syscalls/getxattr/getxattr04.c
2,481
utf_8
11b710cbd52faded3096ddd40ba1c7c0
* Date: Wed Jan 25 07:53:43 2017 -0800 * * xfs: remove racy hasattr check from attr ops */ #include "config.h" #include <errno.h> #include <sys/types.h> #include <string.h> #include <stdlib.h> #include <signal.h> #ifdef HAVE_SYS_XATTR_H # include <sys/xattr.h> #endif #include "tst_test.h" #ifdef HAVE_SYS_XATTR_H ...
google
android
getxattr03
.c
platform/external/ltp/testcases/kernel/syscalls/getxattr/getxattr03.c
2,912
utf_8
9626eba786f1392e2a675455b46207be
/* * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ /* * An empty buffer of size zero can be passed into getxattr(2) to return * the current size of the named extended attribute. */ #include "config.h" #include <sys/types.h> #include <sys/stat.h> #include <sys/wait.h> #include...
google
android
getcpu01
.c
platform/external/ltp/testcases/kernel/syscalls/getcpu/getcpu01.c
3,395
utf_8
6c0f1d7e2ffc557348ad31106d0fc7f2
* * Test Description: * The test process is affined to a CPU. It then calls getcpu and * checks that the CPU and node (if supported) match the expected * values. */ #define _GNU_SOURCE #include <dirent.h> #include <errno.h> #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include "tst_test.h" #in...
google
android
mincore01
.c
platform/external/ltp/testcases/kernel/syscalls/mincore/mincore01.c
5,108
utf_8
0925401f9aa68271cfd2eed735cc0042
/* * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * test1: * Invoke mincore() when the start address is not multiple of page size. * EINVAL * test2: * Invoke mincore() when the vector points to an invalid address. EFAULT * test3: * Invoke mincore() when the starting addres...
google
android
mincore02
.c
platform/external/ltp/testcases/kernel/syscalls/mincore/mincore02.c
3,492
utf_8
2db13ffeaa1a759d77633e17993650bd
/* * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * This test case provides a functional validation for mincore system call. * We mmap a file of known size (multiple of page size) and lock it in * memory. Then we obtain page location information via mincore and compare * the ...
google
android
mincore03
.c
platform/external/ltp/testcases/kernel/syscalls/mincore/mincore03.c
1,838
utf_8
c461bca67758842f37de093bd7a08696
*/ /* * mincore03 * Testcase 1: Test shows that pages mapped as anonymous and * not faulted, are reported as not resident in memory by mincore(). * Testcase 2: Test shows that pages mapped as anonymous and faulted, * are reported as resident in memory by mincore(). */ #include <stdbool.h> #include <unistd.h> #in...
google
android
mincore04
.c
platform/external/ltp/testcases/kernel/syscalls/mincore/mincore04.c
2,267
utf_8
a61cf248d43eb16e7a466ea9123b17fa
*/ /* * mincore04 * Test shows that pages mapped in one process(parent) and * faulted in another(child) results in mincore(in parent) reporting * that all mapped pages are resident. */ #include <unistd.h> #include <sys/types.h> #include <sys/mman.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/wait....
google
android
fspick01
.c
platform/external/ltp/testcases/kernel/syscalls/fspick/fspick01.c
1,591
utf_8
d2c43ccc8e5c2ffb7e3ac6dfdcd78899
* * Basic fspick() test. */ #include "tst_test.h" #include "lapi/fsmount.h" #define MNTPOINT "mntpoint" #define TCASE_ENTRY(_flags) {.name = "Flag " #_flags, .flags = _flags} static struct tcase { char *name; unsigned int flags; } tcases[] = { TCASE_ENTRY(FSPICK_CLOEXEC), TCASE_ENTRY(FSPICK_SYMLINK_NOFOLLOW), ...
google
android
fspick02
.c
platform/external/ltp/testcases/kernel/syscalls/fspick/fspick02.c
1,319
utf_8
93f74d8b01788dadae367aaf73febdac
* * Basic fspick() failure tests. */ #include "tst_test.h" #include "lapi/fsmount.h" #define MNTPOINT "mntpoint" static struct tcase { char *name; int dirfd; const char *pathname; unsigned int flags; int exp_errno; } tcases[] = { {"invalid-fd", -1, MNTPOINT, FSPICK_NO_AUTOMOUNT | FSPICK_CLOEXEC, EBADF}, {"in...
google
android
sched_yield01
.c
platform/external/ltp/testcases/kernel/syscalls/sched_yield/sched_yield01.c
2,336
utf_8
114b3a5458524a4e5dcccb994e993be2
/* * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * NAME * sched_yield01.C * * DESCRIPTION * Testcase to check that sched_yield returns correct values. * * ALGORITHM * Call sched_yield(), check its return value. If it is 0, then pass, * otherwise fail with proper er...
google
android
pidfd_getfd01
.c
platform/external/ltp/testcases/kernel/syscalls/pidfd_getfd/pidfd_getfd01.c
2,106
utf_8
79fdc41349ef3992f3008e4399c0b218
*/ /*\ * [Description] * * Basic pidfd_getfd() test: * * - the close-on-exec flag is set on the file descriptor returned by * pidfd_getfd * - use kcmp to check whether a file descriptor idx1 in the process pid1 * refers to the same open file description as file descriptor idx2 in * the process pid2 */ ...
google
android
pidfd_getfd02
.c
platform/external/ltp/testcases/kernel/syscalls/pidfd_getfd/pidfd_getfd02.c
2,730
utf_8
9d31c5884ee5a95a8c38231f83bd14f2
*/ /*\ * [Description] * * Tests basic error handling of the pidfd_open syscall. * * - EBADF pidfd is not a valid PID file descriptor * - EBADF targetfd is not an open file descriptor in the process referred * to by pidfd * - EINVAL flags is not 0 * - ESRCH the process referred to by pidfd does not exist (i...
google
android
timerfd_settime02
.c
platform/external/ltp/testcases/kernel/syscalls/timerfd/timerfd_settime02.c
2,911
utf_8
e9ef6993bc050ae32290df0790bbc216
* Date: Tue Jan 31 15:24:03 2017 +0100 * * timerfd: Protect the might cancel mechanism proper */ #include <unistd.h> #include "time64_variants.h" #include "tst_timer.h" #include "tst_safe_timerfd.h" #include "tst_fuzzy_sync.h" #define TIMERFD_FLAGS "timerfd_settime(TFD_TIMER_ABSTIME | TFD_TIMER_CANCEL_ON_SET)" ...
google
android
timerfd_settime01
.c
platform/external/ltp/testcases/kernel/syscalls/timerfd/timerfd_settime01.c
2,637
utf_8
087d78359c6d03e311622777c6546b75
* * DESCRIPTION * Verify that, * 1. fd is not a valid file descriptor, EBADF would return. * 2. old_value is not valid a pointer, EFAULT would return. * 3. fd is not a valid timerfd file descriptor, EINVAL would return. * 4. flags is invalid, EINVAL would return. */ #define _GNU_SOURCE #include "time64...
google
android
timerfd03
.c
platform/external/ltp/testcases/kernel/syscalls/timerfd/timerfd03.c
8,607
ibm852
cc54c619e4a835b4ebc80941ff993f6b
/******************************************************************************/ /* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* */ /***********************************************************************...
google
android
timerfd02
.c
platform/external/ltp/testcases/kernel/syscalls/timerfd/timerfd02.c
8,858
ibm852
17fcef2f999565645a5485531a79aafa
/******************************************************************************/ /* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* */ /***********************************************************************...
google
android
timerfd01
.c
platform/external/ltp/testcases/kernel/syscalls/timerfd/timerfd01.c
4,360
utf_8
784fe5758d46135785040381672fcbc8
*/ #define _GNU_SOURCE #include <poll.h> #include "time64_variants.h" #include "tst_timer.h" #include "tst_safe_timerfd.h" static struct tcase { int id; char const *name; } tcases[] = { {CLOCK_MONOTONIC, "CLOCK MONOTONIC"}, {CLOCK_REALTIME, "CLOCK REALTIME"}, }; static struct time64_variants variants[] = { #if (__...
google
android
timerfd_create01
.c
platform/external/ltp/testcases/kernel/syscalls/timerfd/timerfd_create01.c
2,160
utf_8
276a18eda98407fc45e42b0a443e0ed5
/* * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ /* * DESCRIPTION * Verify that, * 1. The clockid argument is neither CLOCK_MONOTONIC nor CLOCK_REALTIME, * EINVAL would return. * 2. flags is invalid, EINVAL would return. */ #define _GNU_SOURCE #include <errno.h> #include "test.h" #includ...
google
android
timerfd_gettime01
.c
platform/external/ltp/testcases/kernel/syscalls/timerfd/timerfd_gettime01.c
2,368
utf_8
b29c6a9d559efa92f4cf1fb56949fae5
* * DESCRIPTION * Verify that, * 1. fd is not a valid file descriptor, EBADF would return. * 2. curr_value is not valid a pointer, EFAULT would return. * 3. fd is not a valid timerfd file descriptor, EINVAL would return. */ #define _GNU_SOURCE #include "time64_variants.h" #include "tst_timer.h" #include "...
google
android
timerfd04
.c
platform/external/ltp/testcases/kernel/syscalls/timerfd/timerfd04.c
3,374
utf_8
20d9669a6fb804e8c79e7283726ae955
*/ /* Test that timerfd adds correctly an offset with absolute expiration time. After a call to unshare(CLONE_NEWTIME) a new timer namespace is created, the process that has called the unshare() can adjust offsets for CLOCK_MONOTONIC and CLOCK_BOOTTIME for its children by writing to the '/proc/self/timens_...
google
android
gettimeofday02
.c
platform/external/ltp/testcases/kernel/syscalls/gettimeofday/gettimeofday02.c
1,632
utf_8
892f22431527def5e6dc644e359af44c
*/ /* * DESCRIPTION * Check if gettimeofday is monotonous * * ALGORITHM * Call gettimeofday() to get a t1 (fist value) * call it again to get t2, see if t2 < t1, set t2 = t1, repeat for 10 sec */ #include <stdint.h> #include <sys/time.h> #include <stdlib.h> #include <unistd.h> #include <time.h> #include <errno....
google
android
gettimeofday01
.c
platform/external/ltp/testcases/kernel/syscalls/gettimeofday/gettimeofday01.c
2,270
utf_8
9595e30c3e189ef6376d70da3fc236e6
/* * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * NAME * gettimeofday01.c * * DESCRIPTION * Testcase to check that gettimeofday(2) sets errno to EFAULT. * * ALGORITHM * Call gettimeofday() with an invalid buffer, and expect EFAULT to be * set in errno. * * HISTO...
google
android
vhangup02
.c
platform/external/ltp/testcases/kernel/syscalls/vhangup/vhangup02.c
762
utf_8
5eac1e6853e0f2c9215e3e15111a7d12
* * History * 07/2001 John George * -Ported */ #include <unistd.h> #include <sys/types.h> #include <errno.h> #include <pwd.h> #include <sys/wait.h> #include "tst_test.h" #include "lapi/syscalls.h" static void run(void) { pid_t pid, pid1; pid = SAFE_FORK(); if (pid > 0) { waitpid(pid, NULL, 0); } else { pi...
google
android
vhangup01
.c
platform/external/ltp/testcases/kernel/syscalls/vhangup/vhangup01.c
1,129
utf_8
82ed9f654d33d607f1d9f802a22a2b15
* * Check the return value, and errno of vhangup(2) when a non-root user calls * vhangup(). */ #include <unistd.h> #include <errno.h> #include <pwd.h> #include <sys/wait.h> #include "tst_test.h" #include "lapi/syscalls.h" static uid_t nobody_uid; static void run(void) { pid_t pid; int retval; pid = SAFE_FORK(); ...
google
android
getrandom01
.c
platform/external/ltp/testcases/kernel/syscalls/getrandom/getrandom01.c
692
utf_8
09296fad8b0bbd2732fafafded2efce1
* * Calls getrandom(2) with a NULL buffer and expects failure. */ #include "tst_test.h" #include "lapi/getrandom.h" #include "lapi/syscalls.h" static int modes[] = {0, GRND_RANDOM, GRND_NONBLOCK, GRND_RANDOM | GRND_NONBLOCK}; static void verify_getrandom(unsigned int n) { TEST(tst_syscall(__NR_getrandom, NU...
google
android
getrandom02
.c
platform/external/ltp/testcases/kernel/syscalls/getrandom/getrandom02.c
1,446
utf_8
74603b06b0a5c6f33955a6552f98eb52
* * Calls getrandom(2), checks that the buffer is filled with random bytes * and expects success. */ #include "tst_test.h" #include "lapi/getrandom.h" #include "lapi/syscalls.h" #define PROC_ENTROPY_AVAIL "/proc/sys/kernel/random/entropy_avail" static int modes[] = { 0, GRND_RANDOM, GRND_NONBLOCK, GRND_RAN...
google
android
getrandom03
.c
platform/external/ltp/testcases/kernel/syscalls/getrandom/getrandom03.c
806
utf_8
969912c89c2c9c198ee094236f4c54d6
* * Calls getrandom(2), check that the return value is equal to the * number of bytes required and expects success. */ #include "tst_test.h" #include "lapi/getrandom.h" #include "lapi/syscalls.h" #define MAX_SIZE 256 static unsigned int sizes[] = { 1, 2, 3, 7, 8, 15, 22, 64, 127, }; static void verify_getr...
google
android
getrandom04
.c
platform/external/ltp/testcases/kernel/syscalls/getrandom/getrandom04.c
827
utf_8
ff0e52fe5787cb2e7d6bbdcee3e8de35
* * Calls getrandom(2) after having limited the number of available file * descriptors to 3 and expects success. */ #include <sys/resource.h> #include "tst_test.h" #include "lapi/getrandom.h" #include "lapi/syscalls.h" static void verify_getrandom(void) { char buf[128]; struct rlimit lold, lnew; } static struct t...