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 | inotify12 | .c | platform/external/ltp/testcases/kernel/syscalls/inotify/inotify12.c | 3,830 | utf_8 | 4b4679fa2e88892eb1fa1a0518a0b520 | */
/*\
* [Description]
* Test special inotify mask flags.
*
* Regression test for kernel commit:
* a32e697cda27 ("inotify: show inotify mask flags in proc fdinfo")
*/
#include "config.h"
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <signal.h>
#include <sys/wait.h>
#include "tst_test.h"
#inc... |
google | android | inotify03 | .c | platform/external/ltp/testcases/kernel/syscalls/inotify/inotify03.c | 4,018 | utf_8 | f6c742db4422c3f9faf8958c845cbb84 | *
* DESCRIPTION
* Check that inotify get IN_UNMOUNT event and
* don't block the umount command.
*
* ALGORITHM
* Execute sequence file's operation and check return events
*/
#include "config.h"
#include <stdio.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <err... |
google | android | inotify01 | .c | platform/external/ltp/testcases/kernel/syscalls/inotify/inotify01.c | 3,695 | utf_8 | 17c0c378e66843da7fae8ded709e5546 | *
* DESCRIPTION
* Check that inotify work for a file
*
* ALGORITHM
* Execute sequence file's operation and check return events
*/
#include "config.h"
#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>
#include <sys/syscall.h>
#include... |
google | android | inotify07 | .c | platform/external/ltp/testcases/kernel/syscalls/inotify/inotify07.c | 5,133 | utf_8 | 5cdc9053072aeee482815b861acdc1a5 | *
* DESCRIPTION
* Check that inotify work for an overlayfs directory after copy up and
* drop caches.
*
* An inotify watch pins the directory inode in cache, but not the dentry.
* The watch will not report events on the directory if overlayfs does not
* obtain the pinned inode to the new all... |
google | android | inotify08 | .c | platform/external/ltp/testcases/kernel/syscalls/inotify/inotify08.c | 4,789 | utf_8 | 7831d6a2e14a110beb2fb592fd586bb7 | *
* DESCRIPTION
* Check that inotify work for an overlayfs file after copy up and
* drop caches.
*
* An inotify watch pins the file inode in cache, but not the dentry.
* The watch will not report events on the file if overlayfs does not
* obtain the pinned inode to the new allocated dentry a... |
google | android | profil01 | .c | platform/external/ltp/testcases/kernel/syscalls/profil/profil01.c | 3,490 | utf_8 | d5144bee234e8fe08409aa8526c31763 | /*
*/
/*
* ALGORITHM
* Set up a profiling buffer, turn profiling on, set a timer for
* cpu time, spin the pc and wait for timer to go off.
* The profiling buffer should contain some info, highly concentrated.
* We just do a "looks reasonable" check.
*/
#include <stdio.h>
#include <signal.h>
#include <unistd.h>
#... |
google | android | access01 | .c | platform/external/ltp/testcases/kernel/syscalls/access/access01.c | 9,520 | utf_8 | c1b192ee8f5834fbac2fac551a72359c | * AUTHOR : William Roske
*/
/*
* Basic test for access(2) using F_OK, R_OK, W_OK and X_OK
*/
#include <errno.h>
#include <unistd.h>
#include <sys/types.h>
#include <pwd.h>
#include "tst_test.h"
#define FNAME_RWX "accessfile_rwx"
#define FNAME_R "accessfile_r"
#define FNAME_W "accessfile_w"
#define FNAME_X ... |
google | android | access03 | .c | platform/external/ltp/testcases/kernel/syscalls/access/access03.c | 1,155 | utf_8 | 369bfa64eef1a57da5dc11e63c5f076d | */
/*
* access(2) test for errno(s) EFAULT as root and nobody respectively.
*/
#include <errno.h>
#include <unistd.h>
#include <sys/types.h>
#include <pwd.h>
#include "tst_test.h"
static uid_t uid;
static struct tcase {
void *addr;
int mode;
char *name;
} tcases[] = {
{(void *)-1, F_OK, "F_OK"},
{(void *)-1, R_... |
google | android | access04 | .c | platform/external/ltp/testcases/kernel/syscalls/access/access04.c | 2,664 | utf_8 | bd41fa5506e093dccf09432b1aca54d0 | */
/*
* Verify that,
* 1) access() fails with -1 return value and sets errno to EINVAL
* if the specified access mode argument is invalid.
* 2) access() fails with -1 return value and sets errno to ENOENT
* if the specified file doesn't exist (or pathname is NULL).
* 3) access() fails with -1 return v... |
google | android | access02 | .c | platform/external/ltp/testcases/kernel/syscalls/access/access02.c | 4,290 | utf_8 | dbad433156e8b6834fe7f116f319dc9c | */
/*
* Test Description:
* Verify that access() succeeds to check the existence or read/write/execute
* permissions on a file if the mode argument passed was F_OK/R_OK/W_OK/X_OK.
*
* Also verify that, access() succeeds to test the accessibility of the file
* referred to by symbolic link if the pathname poin... |
google | android | sockioctl01 | .c | platform/external/ltp/testcases/kernel/syscalls/sockioctl/sockioctl01.c | 5,703 | utf_8 | a9e9075256a3d1758bc5e4f4264ab024 | /*
*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* Test Name: sockioctl01
*
* Test Description:
* Verify that ioctl() on sockets returns the proper errno for various
* failure cases
*/
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
#inc... |
google | android | bpf_prog06 | .c | platform/external/ltp/testcases/kernel/syscalls/bpf/bpf_prog06.c | 3,869 | utf_8 | e31604f0ee874ceede2a9462039272c7 | */
/*\
* [Description]
*
* ringbuf_submit takes a pointer to a ringbuf record, but not the
* size of this record. The verifier only validates offset ptrs[1] passed
* to functions if the function has a size parameter. So we can
* perform a wide range of ptr arithmetic on this record ptr.
*
* ringbuf_submit upda... |
google | android | bpf_prog05 | .c | platform/external/ltp/testcases/kernel/syscalls/bpf/bpf_prog05.c | 5,312 | utf_8 | 3bced212156100f87fd1144c94cee8c5 | */
/*\
* [Description]
*
* Compare the effects of 32-bit div/mod by zero with the "expected"
* behaviour.
*
* The commit "bpf: fix subprog verifier bypass by div/mod by 0
* exception", changed div/mod by zero from exiting the current
* program to setting the destination register to zero (div) or
* leaving it ... |
google | android | bpf_prog07 | .c | platform/external/ltp/testcases/kernel/syscalls/bpf/bpf_prog07.c | 4,148 | utf_8 | 6c705ffd523d8fdd14d7dfbb21dbcdba | */
/*\
* [Description]
*
* The verifier did not properly restrict some *_OR_NULL pointer
* types. Including RET_PTR_TO_ALLOC_MEM_OR_NULL which is returned by
* ringbuf_reserve. Somehow this means they can be used to perform
* arbitrary pointer arithmetic.
*
* The test tries to do some pointer arithmetic on the... |
google | android | bpf_prog02 | .c | platform/external/ltp/testcases/kernel/syscalls/bpf/bpf_prog02.c | 3,672 | utf_8 | 7d751a3d1bbed38103c25744854fab6b | *
* Check if eBPF can do arithmetic with 64bits. This targets a specific
* regression which only effects unprivileged users who are subject to extra
* pointer arithmetic checks during verification.
*
* Fixed by commit 3612af783cf52c74a031a2f11b82247b2599d3cd.
* https://new.blog.cloudflare.com/ebpf-cant-count/
*... |
google | android | bpf_common | .c | platform/external/ltp/testcases/kernel/syscalls/bpf/bpf_common.c | 3,428 | utf_8 | 8e8f5e6ad6c6aa03e0de352303361fba | (long)memlock_r.rlim_cur);
if (memlock_r.rlim_cur <= memlock_r.rlim_max) {
"due to lack of max locked memory");
}
}
int bpf_map_create(union bpf_attr *const attr)
{
int ret;
ret = TST_RETRY_FUNC(bpf(BPF_MAP_CREATE, attr, sizeof(*attr)),
TST_RETVAL_GE0);
if (ret == -1) {
if (errno == EPERM) {
tst_res(TC... |
google | android | bpf_prog01 | .c | platform/external/ltp/testcases/kernel/syscalls/bpf/bpf_prog01.c | 2,740 | utf_8 | 74eb73a4ad54939bc5c64bba5b73cafa | *
* Trivial Extended Berkeley Packet Filter (eBPF) test.
*
* Sanity check loading and running bytecode.
*
* Test flow:
* 1. Create array map
* 2. Load eBPF program
* 3. Attach program to socket
* 4. Send packet on socket
* 5. This should trigger eBPF program which writes to array map
* 6. Verify array map w... |
google | android | bpf_prog04 | .c | platform/external/ltp/testcases/kernel/syscalls/bpf/bpf_prog04.c | 2,991 | utf_8 | f96c0c0326b9ed6d455ada9e6ebfda83 | * Date: Fri Oct 5 18:17:59 2018 +0200
*
* bpf: 32-bit RSH verification must truncate input before the ALU op
*/
#include <stdio.h>
#include <string.h>
#include "config.h"
#include "tst_test.h"
#include "tst_taint.h"
#include "tst_capability.h"
#include "bpf_common.h"
#define BUFSIZE 8192
#define CHECK_BPF_RET(x... |
google | android | bpf_prog03 | .c | platform/external/ltp/testcases/kernel/syscalls/bpf/bpf_prog03.c | 4,470 | utf_8 | 0336fee238de020eea9efaf4bc09725e | *
* Check for the bug fixed by 95a762e2c8c942780948091f8f2a4f32fce1ac6f
* "bpf: fix incorrect sign extension in check_alu_op()"
* CVE-2017-16995
*
* This test is very similar to the reproducer found here:
* https://bugs.chromium.org/p/project-zero/issues/detail?id=1454
*
* However it has been modified to try t... |
google | android | bpf_map01 | .c | platform/external/ltp/testcases/kernel/syscalls/bpf/bpf_map01.c | 3,324 | utf_8 | a7a0286c5cc5988be096757871cb0be6 | *
* Trivial Extended Berkeley Packet Filter (eBPF) test.
*
* Sanity check creating and updating maps.
*/
/*
* If test is executed in a loop and limit for locked memory (ulimit -l) is
* too low bpf() call can fail with EPERM due to deffered freeing.
*/
#include <limits.h>
#include <string.h>
#include "config.h"
... |
google | android | epoll_create02 | .c | platform/external/ltp/testcases/kernel/syscalls/epoll_create/epoll_create02.c | 743 | utf_8 | e5cbebf67c90aadb12a35370fba1add5 | */
/*\
* [Description]
*
* Verify that epoll_create returns -1 and set errno to EINVAL if size is not
* greater than zero.
*/
#include <sys/epoll.h>
#include "tst_test.h"
#include "lapi/epoll.h"
#include "lapi/syscalls.h"
#include "epoll_create.h"
static struct test_case_t {
int size;
int exp_err;
} tc[] = {
{... |
google | android | epoll_create01 | .c | platform/external/ltp/testcases/kernel/syscalls/epoll_create/epoll_create01.c | 859 | utf_8 | d3231e72ed73f1fe9e9b745a2434b3ff | */
/*\
* [Description]
*
* Verify that epoll_create return a nonnegative file descriptor on success.
*
* The size argument informed the kernel of the number of file descriptors
* that the caller expected to add to the epoll instance, but it is no longer
* required.
*/
#include <sys/epoll.h>
#include "tst_test.... |
google | android | pipe2_02 | .c | platform/external/ltp/testcases/kernel/syscalls/pipe2/pipe2_02.c | 1,309 | utf_8 | 5146f29edfbdb0024fb9c732934c5baa | *
* This case is designed to test the basic functionality about the
* O_CLOEXEC flag of pipe2.
*/
#define _GNU_SOURCE
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include "lapi/fcntl.h"
#include "tst_test.h"
#define TESTBIN "pipe2_02_child"
static int fds[2];
static void cleanup(void)
{
if (fds[0] >... |
google | android | pipe2_01 | .c | platform/external/ltp/testcases/kernel/syscalls/pipe2/pipe2_01.c | 2,094 | utf_8 | 4e3eb4a9af2b7fb138f82e64148cde0b | */
#define _GNU_SOURCE
#include <stdio.h>
#include <unistd.h>
#include "lapi/fcntl.h"
#include "tst_test.h"
static int fds[2];
static struct tcase {
int flags;
int cmd;
int check_read_end;
char *message;
} tcases[] = {
{0, F_GETFD, 1, "Test pipe2 with 0 flag"},
{O_CLOEXEC, F_GETFD, 1, "Test pipe2 using O_CLOEXEC... |
google | android | pipe2_02_child | .c | platform/external/ltp/testcases/kernel/syscalls/pipe2/pipe2_02_child.c | 491 | utf_8 | 868b5c8f160f4f0f4e8808b218d853cb | */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
int main(int argc, char **argv)
{
int fd;
if (argc != 2) {
fprintf(stderr, "Only two arguments: %s <fd>\n", argv[0]);
exit(1);
}
fd = atoi(argv[1]);
if (fcntl(fd, F_GETFL) < 0 && errno == EBADF)
return 0;
re... |
google | android | pipe2_04 | .c | platform/external/ltp/testcases/kernel/syscalls/pipe2/pipe2_04.c | 2,650 | utf_8 | baadc4b520e9a3db934a83c16b5c1fe0 | *
* Test Description:
* This Program tests getting and setting the pipe size.
* It also tests what happen when you write to a full pipe depending on whether
* O_NONBLOCK is set or not.
*/
#define _GNU_SOURCE
#include <stdlib.h>
#include <features.h>
#include <unistd.h>
#include <stdio.h>
#include "lapi/fcntl.h"
#... |
google | android | fcntl15 | .c | platform/external/ltp/testcases/kernel/syscalls/fcntl/fcntl15.c | 4,414 | utf_8 | c2a9af7f3583a60d4daf3c41e9f33a27 | * for unique ID on NPTL threading
*/
/*\
* [Description]
*
* Check that file locks are removed when a file descriptor is closed, three
* different tests are implemented.
*
* Parent opens a file and duplicates the file descriptor, places locks using
* both file descriptors then closes one descriptor, all locks ... |
google | android | fcntl27 | .c | platform/external/ltp/testcases/kernel/syscalls/fcntl/fcntl27.c | 5,124 | utf_8 | 15b01541eed4b3e51db20403d08059a8 | /*
*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**********************************************************
*
* TEST IDENTIFIER : fcntl27
*
* EXECUTED BY : anyone
*
* TEST TITLE : Basic test for fcntl(2) using F_SETLEASE & F_RDLCK argument.
*
* TEST ... |
google | android | fcntl24 | .c | platform/external/ltp/testcases/kernel/syscalls/fcntl/fcntl24.c | 5,620 | utf_8 | 89fb8d03ce2266b3b44b7deef7e6ed52 | /*
*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**********************************************************
*
* TEST IDENTIFIER : fcntl24
*
* EXECUTED BY : anyone
*
* TEST TITLE : Basic test for fcntl(2) using F_SETLEASE & F_WRLCK argument.
*
* TEST CASE T... |
google | android | fcntl17 | .c | platform/external/ltp/testcases/kernel/syscalls/fcntl/fcntl17.c | 14,454 | utf_8 | 0523fb6e12bc7f26617a92fa68b0f454 | /*
*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* NAME
* fcntl17.c
*
* DESCRIPTION
* Check deadlock detection for file locking
*
* ALGORITHM
* The parent forks off 3 children. The parent controls the children
* with messages via pipes to create a delayed deadlock ... |
google | android | fcntl32 | .c | platform/external/ltp/testcases/kernel/syscalls/fcntl/fcntl32.c | 2,935 | utf_8 | b41448afcd91b9ff19974cdebae2c76b | /*
* alone with this program.
*/
/*
* DESCRIPTION
* Basic test for fcntl(2) using F_SETLEASE & F_WRLCK argument.
* "A write lease may be placed on a file only if there are
* no other open file descriptors for the file."
*/
#include <errno.h>
#include "test.h"
#include "safe_macros.h"
static void setup(void);
... |
google | android | fcntl12 | .c | platform/external/ltp/testcases/kernel/syscalls/fcntl/fcntl12.c | 1,181 | utf_8 | 4168dc35192246f8e99a298743c75e9f | * 07/2001 Ported by Wayne Boyer
*/
/*\
* [Description]
*
* Tests basic error handling of the fcntl syscall.
*
* - EMFILE when cmd is F_DUPFD and the per-process limit on the number of open
* file descriptors has been reached.
*/
#include <fcntl.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <stdlib... |
google | android | fcntl38 | .c | platform/external/ltp/testcases/kernel/syscalls/fcntl/fcntl38.c | 2,316 | utf_8 | 1ad122ea9d633a91c0cb808b935e488f | *
* DESCRIPTION
* Check that dnotify event is reported to both parent and subdir
*/
#include <signal.h>
#include <stdio.h>
#include <unistd.h>
#include "tst_test.h"
#include "lapi/fcntl.h"
#define TEST_DIR "test_dir"
#define TEST_SIG SIGRTMIN+1
static int parent_fd, subdir_fd;
static int got_parent_event, got_s... |
google | android | fcntl14 | .c | platform/external/ltp/testcases/kernel/syscalls/fcntl/fcntl14.c | 30,237 | utf_8 | c58a7920aca1302dff93b93845807439 | /*
*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* NAME
* fcntl14.c
*
* DESCRIPTION
* File locking test cases for fcntl. In Linux, S_ENFMT is not implemented
* in the kernel. However all standard Unix kernels define S_ENFMT as
* S_ISGID. So this test defines S_ENFMT ... |
google | android | fcntl19 | .c | platform/external/ltp/testcases/kernel/syscalls/fcntl/fcntl19.c | 13,850 | utf_8 | 25fa0dd69bd1c5016bde57805eab0060 | /*
*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* NAME
* fcntl19.c
*
* DESCRIPTION
* Testcase to check locking of regions of a file
*
* CALLS
* fcntl
*
* ALGORITHM
* Test unlocking sections around a write lock
*
* USAGE
* fcntl19
*
* HISTORY
* 07/2001 Port... |
google | android | fcntl03 | .c | platform/external/ltp/testcases/kernel/syscalls/fcntl/fcntl03.c | 966 | utf_8 | f44f0edaebe2a4d97458236cc8df1ae7 | */
/*
* Basic test for fcntl(2) using F_GETFD argument.
*/
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <stdio.h>
#include "tst_test.h"
static char fname[255];
static int fd;
static void verify_fcntl(void)
{
TEST(fcntl(fd, F_GETFD, 0));
if (TST_... |
google | android | fcntl33 | .c | platform/external/ltp/testcases/kernel/syscalls/fcntl/fcntl33.c | 5,569 | utf_8 | dac72a69162f29bbadd23ae6572adaba | */
/*
* DESCRIPTION
* Test for feature F_SETLEASE of fcntl(2).
* "F_SETLEASE is used to establish a lease which provides a mechanism:
* When a process (the lease breaker) performs an open(2) or truncate(2)
* that conflicts with the lease, the system call will be blocked by
* kernel, meanwhile the kernel ... |
google | android | fcntl26 | .c | platform/external/ltp/testcases/kernel/syscalls/fcntl/fcntl26.c | 5,721 | utf_8 | 0aab64cbb3d0022a410c0618f0a8c773 | /*
*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**********************************************************
*
* TEST IDENTIFIER : fcntl26
*
* EXECUTED BY : anyone
*
* TEST TITLE : Basic test for fcntl(2) using F_SETLEASE & F_WRLCK argument.
*
* TEST ... |
google | android | fcntl10 | .c | platform/external/ltp/testcases/kernel/syscalls/fcntl/fcntl10.c | 6,737 | utf_8 | a97f6df79df2dc2e6890aab3087a08cb | /*
* 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 | fcntl23 | .c | platform/external/ltp/testcases/kernel/syscalls/fcntl/fcntl23.c | 5,475 | utf_8 | cff792a4302b135065e7a2b279ef9d40 | /*
*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**********************************************************
*
* TEST IDENTIFIER : fcntl23
*
* EXECUTED BY : anyone
*
* TEST TITLE : Basic test for fcntl(2) using F_SETLEASE & F_RDLCK argument.
*
* TEST CASE T... |
google | android | fcntl31 | .c | platform/external/ltp/testcases/kernel/syscalls/fcntl/fcntl31.c | 8,455 | utf_8 | b67120eb842550fcdcc2d8c3c0f70b4a | /*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/*
* Description:
* Verify that:
* Basic test for fcntl(2) using F_GETOWN, F_SETOWN, F_GETOWN_EX,
* F_SETOWN_EX, F_GETSIG, F_SETSIG argument.
*/
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include <sign... |
google | android | fcntl39 | .c | platform/external/ltp/testcases/kernel/syscalls/fcntl/fcntl39.c | 3,213 | utf_8 | 337bc196e709c8c6f4571de776fe2bf5 | */
/*\
* [Description]
*
* Check that dnotify DN_RENAME event is reported only on rename inside same parent.
*/
#include <fcntl.h>
#include <signal.h>
#include <stdio.h>
#include <unistd.h>
#include "tst_test.h"
#include "lapi/fcntl.h"
#define TEST_DIR "test_dir"
#define TEST_DIR2 "test_dir2"
#define TEST_FILE "te... |
google | android | fcntl08 | .c | platform/external/ltp/testcases/kernel/syscalls/fcntl/fcntl08.c | 2,345 | utf_8 | b772f71caadf3b5e40f0445cc502f470 | /*
* 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 | fcntl04 | .c | platform/external/ltp/testcases/kernel/syscalls/fcntl/fcntl04.c | 1,151 | utf_8 | b1a41ffdfa6016680f4e674c95700f99 | */
/*
* Basic test for fcntl(2) using F_GETFL argument.
*/
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <stdio.h>
#include "tst_test.h"
static int fd;
static char fname[255];
static void verify_fcntl(void)
{
TEST(fcntl(fd, F_GETFL, 0));
if (TST_... |
google | android | fcntl35 | .c | platform/external/ltp/testcases/kernel/syscalls/fcntl/fcntl35.c | 2,820 | utf_8 | ce794c9de6df4c27be6e392ebf92e596 | */
/*
* Description:
* fcntl(2) manpage states that an unprivileged user could not set the
* pipe capacity above the limit in /proc/sys/fs/pipe-max-size. However,
* an unprivileged user could create a pipe whose initial capacity exceeds
* the limit. We add a regression test to check that pipe-max-size caps
* t... |
google | android | fcntl01 | .c | platform/external/ltp/testcases/kernel/syscalls/fcntl/fcntl01.c | 4,491 | utf_8 | ca145cf4391fb33fb8f61873ed731bb5 | /*
* NAME
* fcntl01.c
*
* DESCRIPTION
* Test F_DUPFD, F_SETFL cmds of fcntl
*
* CALLS
* fcntl
*
* ALGORITHM
*
* 1. Testing F_DUPFD cmd with arg less than, equal to, and greater
* than the next available file descriptor.
*
* 2. Checking F_SETFL cmd with each valid flag (O_NDELAY, O_APPEND).
*
* 3. Ch... |
google | android | fcntl22 | .c | platform/external/ltp/testcases/kernel/syscalls/fcntl/fcntl22.c | 2,777 | utf_8 | c87d62b2260838c6c1a5faba070b016c | /*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* Test Name: fcntl22
*
* Test Description:
* Verify that, fcntl() fails with -1 and sets errno to EAGAIN when
* Operation is prohibited by locks held by other processes.
*
* Expected Result:
* fcntl() should fa... |
google | android | fcntl36 | .c | platform/external/ltp/testcases/kernel/syscalls/fcntl/fcntl36.c | 8,370 | utf_8 | eaed557f9c69a2ad2f57975c6fdb3fef | *
* This is testing OFD locks racing with POSIX locks:
*
* OFD read lock vs OFD write lock
* OFD read lock vs POSIX write lock
* OFD write lock vs POSIX write lock
* OFD write lock vs POSIX read lock
* OFD write lock vs OFD write lock
*
* OFD r/w locks vs POSIX write locks
* OFD ... |
google | android | fcntl07 | .c | platform/external/ltp/testcases/kernel/syscalls/fcntl/fcntl07.c | 4,742 | utf_8 | 2b5d01878bf95ec5dc23ee686c1b79b4 | /*
* 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 | fcntl34 | .c | platform/external/ltp/testcases/kernel/syscalls/fcntl/fcntl34.c | 2,665 | utf_8 | a05b6172b756a0db03fe01c9f3156f5c | */
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <pthread.h>
#include <sched.h>
#include "fcntl_common.h"
#include "tst_safe_pthread.h"
static int thread_cnt;
static const int max_thread_cnt = 32;
static const char fname[] = "tst_ofd_locks";
const int writes_num = 100;
const int write_size ... |
google | android | fcntl28 | .c | platform/external/ltp/testcases/kernel/syscalls/fcntl/fcntl28.c | 5,061 | utf_8 | 795a4fbdc5e571c9d57307413ab17c03 | /*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**********************************************************
*
* TEST IDENTIFIER : fcntl28
*
* EXECUTED BY : anyone
*
* TEST TITLE : Basic test for fcntl(2) using F_SETLEASE & F_RDLCK argument.
*
* TEST CAS... |
google | android | fcntl30 | .c | platform/external/ltp/testcases/kernel/syscalls/fcntl/fcntl30.c | 2,409 | utf_8 | a773f4a8c7acba0278a6e2dd8ade136b | /*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/*
* Description:
* Verify that,
* Basic test for fcntl(2) using F_SETPIPE_SZ, F_GETPIPE_SZ argument.
*/
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include <signal.h>
#include <sys/types.h>
#include <pwd.h>... |
google | android | fcntl05 | .c | platform/external/ltp/testcases/kernel/syscalls/fcntl/fcntl05.c | 1,648 | utf_8 | 36509f20a339425162c30fdeb7d40245 | * 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/
*
* AUTHOR : William Roske
* CO-PILOT : Dave Fenner
... |
google | android | fcntl29 | .c | platform/external/ltp/testcases/kernel/syscalls/fcntl/fcntl29.c | 2,136 | utf_8 | 95fcc1d06367bf5f5910ef6b077dc0d3 | /*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/*
* Description:
* Verify that,
* Basic test for fcntl(2) using F_DUPFD_CLOEXEC argument.
*/
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/stat.h>
#includ... |
google | android | fcntl11 | .c | platform/external/ltp/testcases/kernel/syscalls/fcntl/fcntl11.c | 15,165 | utf_8 | 2848b6c2b94c3f8fd8a3b6e2a7d22edd | /*
*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* NAME
* fcntl11.c
*
* DESCRIPTION
* Testcase to check locking of regions of a file
*
* ALGORITHM
* Test changing lock sections around a write lock
*
* USAGE
* fcntl11
*
* HISTORY
* 07/2001 Ported by Wayne Boyer... |
google | android | fcntl20 | .c | platform/external/ltp/testcases/kernel/syscalls/fcntl/fcntl20.c | 13,707 | utf_8 | 7f0e5061ca50696bd9d18b6ff0749a02 | /*
*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* NAME
* fcntl20.c
*
* DESCRIPTION
* Check locking of regions of a file
*
* ALGORITHM
* Test unlocking sections around a read lock
*
* USAGE
* fcntl20
*
* HISTORY
* 07/2001 Ported by Wayne Boyer
*
* RESTRICTIO... |
google | android | fcntl09 | .c | platform/external/ltp/testcases/kernel/syscalls/fcntl/fcntl09.c | 6,638 | utf_8 | a156243d4994e65f7edcff15a0c39ade | /*
* 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 | fcntl06 | .c | platform/external/ltp/testcases/kernel/syscalls/fcntl/fcntl06.c | 3,737 | utf_8 | cb0c297e1eba5a6e102bb9c9450fb720 | /*
*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* NAME
* fcntl06.c
*
* DESCRIPTION
* Error checking conditions for remote locking of regions of a file.
*
* CALLS
* open(2), write(2), fcntl(2)
*
* ALGORITHM
* Test unlocking sections around a write lock using remo... |
google | android | fcntl37 | .c | platform/external/ltp/testcases/kernel/syscalls/fcntl/fcntl37.c | 2,458 | utf_8 | cb35f348cdd47bf718ecf4d4547c5932 | *
* Test basic error handling for fcntl(2) using F_SETPIPE_SZ, F_GETPIPE_SZ
* argument.
* 1)fcntl fails with EINVAL when cmd is F_SETPIPE_SZ and the arg is
* beyond 1<<31.
* 2)fcntl fails with EBUSY when cmd is F_SETPIPE_SZ and the arg is smaller
* than the amount of the current used buffer space.
* 3)fcntl fai... |
google | android | fcntl02 | .c | platform/external/ltp/testcases/kernel/syscalls/fcntl/fcntl02.c | 1,254 | utf_8 | 163491c51a201191036fa446dadb2e5d | */
/*
* Basic test for fcntl(2) using F_DUPFD argument.
*/
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <stdio.h>
#include "tst_test.h"
static int fd;
static char fname[256];
static const int min_fds[] = {0, 1, 2, 3, 10, 100};
static void verify_f... |
google | android | fcntl13 | .c | platform/external/ltp/testcases/kernel/syscalls/fcntl/fcntl13.c | 1,400 | utf_8 | f8e8534877ffc966fda24a6ce0a71dc2 | * 07/2001 Ported by Wayne Boyer
*/
/*\
* [Description]
*
* Tests basic error handling of the fcntl syscall.
*
* - EFAULT when lock is outside your accessible address space
* - EINVAL when cmd argument is not recognized by this kernel
* - EINVAL when cmd argument is F_SETLK and flock.l_whence is not equal to
*... |
google | android | fcntl18 | .c | platform/external/ltp/testcases/kernel/syscalls/fcntl/fcntl18.c | 4,410 | utf_8 | eb5f1a217cbd75aa1a6a8eb72d4b0495 | /*
*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* NAME
* fcntl18.c
*
* DESCRIPTION
* Test to check the error conditions in fcntl system call
*
* USAGE
* fcntl18
*
* HISTORY
* 07/2001 Ported by Wayne Boyer
*
* RESTRICTIONS
* NONE
*/
#include <signal.h>
#inclu... |
google | android | fcntl21 | .c | platform/external/ltp/testcases/kernel/syscalls/fcntl/fcntl21.c | 18,777 | utf_8 | 462f733e26b3695ec1abecd6d0a6d5be | /*
*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* NAME
* fcntl21.c
*
* DESCRIPTION
* Check locking of regions of a file
*
* ALGORITHM
* Test changing lock sections around a read lock
*
* USAGE
* fcntl21
*
* HISTORY
* 07/2001 Ported by Wayne Boyer
*
* RESTRI... |
google | android | fcntl25 | .c | platform/external/ltp/testcases/kernel/syscalls/fcntl/fcntl25.c | 5,723 | utf_8 | 8b0af5281d2edfe5e8626d3400b63979 | /*
*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**********************************************************
*
* TEST IDENTIFIER : fcntl25
*
* EXECUTED BY : anyone
*
* TEST TITLE : Basic test for fcntl(2) using F_SETLEASE & F_WRLCK argument.
*
* TEST ... |
google | android | fcntl16 | .c | platform/external/ltp/testcases/kernel/syscalls/fcntl/fcntl16.c | 17,317 | utf_8 | b10c409730df48c6801c343159cea674 | /*
*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* NAME
* fcntl16.c
*
* DESCRIPTION
* Additional file locking test cases for checking proper notifictaion
* of processes on lock change
*
* ALGORITHM
* Various test cases are used to lock a file opened without mandato... |
google | android | capget01 | .c | platform/external/ltp/testcases/kernel/syscalls/capget/capget01.c | 1,477 | utf_8 | 8256fb91449e3388f9ed43d9129574fd | *
* Description:
* This case tests capget() syscall whether works well on three versions.
* Also, it checks the results buffer.
*/
#include <sys/types.h>
#include "tst_test.h"
#include "lapi/syscalls.h"
#include <linux/capability.h>
static pid_t pid;
static struct __user_cap_header_struct *hdr;
static struct __use... |
google | android | capget02 | .c | platform/external/ltp/testcases/kernel/syscalls/capget/capget02.c | 2,529 | utf_8 | 350be3d95eb53ff0d8b8d655e5130cd6 | *
* Tests basic error handling of the capget syscall.
* 1) capget() fails with errno set to EFAULT if an invalid address
* is given for header.
* 2) capget() fails with errno set to EFAULT if an invalid address
* is given for data
* 3) capget() fails with errno set to EINVAL if an invalid value
* is given for h... |
google | android | setns01 | .c | platform/external/ltp/testcases/kernel/syscalls/setns/setns01.c | 3,245 | utf_8 | 5b98b4a3b4e5c451f9923b3838e192dd | *
* errno tests for setns(2) - reassociate thread with a namespace
*/
#define _GNU_SOURCE
#include <sys/stat.h>
#include <sys/types.h>
#include <errno.h>
#include <sched.h>
#include <pwd.h>
#include <string.h>
#include "config.h"
#include "tst_test.h"
#include "lapi/syscalls.h"
#include "setns.h"
static const char n... |
google | android | setns02 | .c | platform/external/ltp/testcases/kernel/syscalls/setns/setns02.c | 4,656 | utf_8 | 39eb971c15f952ddcd6a4bdf929c9cf9 | *
* functional test for setns(2) - reassociate thread with a namespace
* 1. create child with CLONE_NEWUTS, set different hostname in child,
* set namespace back to parent ns and check that hostname has changed
* 2. create child with CLONE_NEWIPC, set up shared memory in parent
* and verify that child can't... |
google | android | getitimer01 | .c | platform/external/ltp/testcases/kernel/syscalls/getitimer/getitimer01.c | 3,119 | utf_8 | a49730b5a9c08673f6da8de9b7c3ff86 | */
/*\
* [Description]
*
* Check that a correct call to getitimer() succeeds.
*/
#include "tst_test.h"
#include "tst_safe_clocks.h"
#define SEC 100
#define USEC 10000
static struct timeval tv;
static struct itimerval *value;
static long jiffy;
static struct tcase {
int which;
char *des;
} tcases[] = {
{ITIMER_... |
google | android | getitimer02 | .c | platform/external/ltp/testcases/kernel/syscalls/getitimer/getitimer02.c | 1,468 | utf_8 | 4c2a9b37a146872f6dea39d650856068 | */
/*\
* [Description]
*
* Check that getitimer() call fails:
*
* 1. EFAULT with invalid itimerval pointer
* 2. EINVAL when called with an invalid first argument
*/
#include <stdlib.h>
#include <errno.h>
#include <sys/time.h>
#include "tst_test.h"
#include "lapi/syscalls.h"
static struct itimerval *value;
stati... |
google | android | chroot04 | .c | platform/external/ltp/testcases/kernel/syscalls/chroot/chroot04.c | 938 | utf_8 | c2acf0c06df286c0668e0c8ef8df19dd | *
* 04/2002 Ported by Jacky Malcles
*/
/*\
* [Description]
*
* Testcase to check that chroot sets errno to EACCES.
*
* As a non-root user attempt to perform chroot() to a directory that the user
* does not have a search permission for. The chroot() call should fail with
* EACESS.
*/
#include <stdio.h>
#... |
google | android | chroot01 | .c | platform/external/ltp/testcases/kernel/syscalls/chroot/chroot01.c | 830 | utf_8 | 129aaa7a005ae99391a03240c611159c | */
/*\
* [Description]
*
* Testcase to check the whether chroot sets errno to EPERM.
*
* As a non-root user attempt to perform chroot() to a directory. The
* chroot() call should fail with EPERM
*/
#include <stdlib.h>
#include <pwd.h>
#include "tst_test.h"
static char *path;
static void verify_chroot(void)
{
T... |
google | android | chroot02 | .c | platform/external/ltp/testcases/kernel/syscalls/chroot/chroot02.c | 1,083 | utf_8 | 916431da03dccf600ff5901bce8c14e7 | */
/*\
* [Description]
*
* Basic chroot() functionality test.
*
* - Create a file in the temporary directory
* - Change the root to this temporary directory
* - Check whether this file can be accessed in the new root directory
*/
#include <stdlib.h>
#include "tst_test.h"
#define TMP_FILENAME "chroot02_testfile... |
google | android | chroot03 | .c | platform/external/ltp/testcases/kernel/syscalls/chroot/chroot03.c | 2,120 | utf_8 | e8b17b4592cc5fc7fb47452fd196648d | *
* 07/2001 Ported by Wayne Boyer
*/
/*\
* [Description]
*
* Testcase to test whether chroot(2) sets errno correctly.
*
* - to test whether chroot() is setting ENAMETOOLONG if the
* pathname is more than VFS_MAXNAMELEN.
* - to test whether chroot() is setting ENOTDIR if the argument
* is not a directory... |
google | android | mallopt01 | .c | platform/external/ltp/testcases/kernel/syscalls/mallopt/mallopt01.c | 1,712 | utf_8 | 34941aded33c3368b878f464a8513029 | */
/*\
* [Description]
*
* Basic mallinfo() and mallopt() testing.
*/
#include "../mallinfo/mallinfo_common.h"
#include "tst_safe_macros.h"
#ifdef HAVE_MALLOPT
#define MAX_FAST_SIZE (80 * sizeof(size_t) / 4)
struct mallinfo info;
void test_mallopt(void)
{
char *buf;
buf = SAFE_MALLOC(20480);
info = mallinfo();
... |
google | android | fstatat01 | .c | platform/external/ltp/testcases/kernel/syscalls/fstatat/fstatat01.c | 3,674 | utf_8 | 299116a50c14eeacbd34a8d3c88a74c8 | /*
*/
#define _GNU_SOURCE
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <fcntl.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <signal.h>
#include "config.h"
#include "test.h"
#include "safe_macros.h"
#include "lapi/syscalls.h"
#define TEST_CASES 6
#ifndef AT_FDCWD
... |
google | android | membarrier01 | .c | platform/external/ltp/testcases/kernel/syscalls/membarrier/membarrier01.c | 11,125 | utf_8 | 9b58bef31b33db9ea22438a8d5f7fa79 | */
/*
* Basic tests for membarrier(2) syscall. Tests below are responsible for
* testing the membarrier(2) interface only, without checking if the barrier
* was successful or not. Check test_case structure for each test description.
*/
#include "config.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/... |
google | android | process_vm_readv03 | .c | platform/external/ltp/testcases/kernel/syscalls/cma/process_vm_readv03.c | 5,279 | utf_8 | e72f3225b0a8c0069e6e3ef46ed2d832 | */
/*\
* [Description]
*
* Fork two children, one child mallocs randomly sized trunks of memory
* and initializes them; the other child calls process_vm_readv with
* the remote iovecs initialized to the original process memory
* locations and the local iovecs initialized to randomly sized and
* allocated local ... |
google | android | process_vm01 | .c | platform/external/ltp/testcases/kernel/syscalls/cma/process_vm01.c | 7,031 | utf_8 | 2c81db47bc5e8e45f89c5ec9dead19c1 | */
/*\
* [Description]
*
* Test errno codes in process_vm_readv and process_vm_writev syscalls.
*/
#include <pwd.h>
#include <stdlib.h>
#include "tst_test.h"
#include "lapi/syscalls.h"
struct process_vm_params {
int len;
char *ldummy;
char *rdummy;
pid_t pid;
struct iovec *lvec;
unsigned long liovcnt;
struc... |
google | android | process_vm_readv02 | .c | platform/external/ltp/testcases/kernel/syscalls/cma/process_vm_readv02.c | 2,907 | utf_8 | 46eb8c573f5a255d6829a4cd8b18fb6e | */
/*\
* [Description]
*
* Fork two children, one child allocates memory and initializes it;
* then the other one calls process_vm_readv and reads from the same
* memory location, it then verifies if process_vm_readv returns
* correct data.
*/
#include <stdio.h>
#include <sys/types.h>
#include <sys/wait.h>
#inc... |
google | android | process_vm_writev02 | .c | platform/external/ltp/testcases/kernel/syscalls/cma/process_vm_writev02.c | 2,819 | utf_8 | 470f1ef0e0568c8d15095401da0e4971 | */
/*\
* [Description]
*
* Fork two children, the first one allocates a chunk of memory and the
* other one call process_vm_writev to write known data into the first
* child. Then first child verifies that the data is as expected.
*/
#include <stdlib.h>
#include <sys/types.h>
#include <sys/uio.h>
#include "tst_t... |
google | android | waitid07 | .c | platform/external/ltp/testcases/kernel/syscalls/waitid/waitid07.c | 1,060 | utf_8 | e020302aefb1fcb0ca9fc8027584b4f0 | */
/*\
* [Description]
*
* Test if waitid() filters children killed with SIGSTOP.
*/
#include <sys/wait.h>
#include "tst_test.h"
static siginfo_t *infop;
static void run(void)
{
pid_t pid_child;
pid_child = SAFE_FORK();
if (!pid_child) {
SAFE_KILL(getpid(), SIGSTOP);
TST_CHECKPOINT_WAIT(0);
return;
}
me... |
google | android | waitid08 | .c | platform/external/ltp/testcases/kernel/syscalls/waitid/waitid08.c | 1,412 | utf_8 | 41a05eeec4ccefab8a7253a0f897fd34 | */
/*\
* [Description]
*
* Test if waitid() filters children killed with SIGCONT.
*/
#include <sys/wait.h>
#include "tst_test.h"
static siginfo_t *infop;
static void run(void)
{
pid_t pid_child;
pid_child = SAFE_FORK();
if (!pid_child) {
SAFE_KILL(getpid(), SIGSTOP);
TST_CHECKPOINT_WAIT(0);
return;
}
ts... |
google | android | waitid10 | .c | platform/external/ltp/testcases/kernel/syscalls/waitid/waitid10.c | 1,720 | utf_8 | ef691042724a4005e4e82ba11e937b68 | */
/*\
* [Description]
*
* This test is checking if waitid() syscall recognizes a process that ended
* with division by zero error.
*/
#include <stdlib.h>
#include <sys/wait.h>
#include <sys/prctl.h>
#include "tst_test.h"
static siginfo_t *infop;
static int core_dumps = 1;
static void run(void)
{
pid_t pidchild;... |
google | android | waitid03 | .c | platform/external/ltp/testcases/kernel/syscalls/waitid/waitid03.c | 650 | utf_8 | 29e6bb5d30db53222ed31795b3c3ec07 | */
/*\
* [Description]
*
* Tests if waitid() syscall returns ECHILD when the calling process has no
* child processes.
*/
#include <sys/wait.h>
#include "tst_test.h"
static siginfo_t *infop;
static void run(void)
{
TST_EXP_FAIL(waitid(P_ALL, 0, infop, WNOHANG | WEXITED), ECHILD);
}
static struct tst_test test = ... |
google | android | waitid01 | .c | platform/external/ltp/testcases/kernel/syscalls/waitid/waitid01.c | 862 | utf_8 | 4d72e186b1e93ea8de99a37efa7fe968 | */
/*\
* [Description]
*
* This test is checking if waitid() syscall does wait for WEXITED and check for
* the return value.
*/
#include <stdlib.h>
#include <sys/wait.h>
#include "tst_test.h"
static siginfo_t *infop;
static void run(void)
{
pid_t pidchild;
pidchild = SAFE_FORK();
if (!pidchild)
exit(123);
T... |
google | android | waitid02 | .c | platform/external/ltp/testcases/kernel/syscalls/waitid/waitid02.c | 620 | utf_8 | 6dc1782c4b315246b23b7a5bd0286819 | */
/*\
* [Description]
*
* Tests if waitid() returns EINVAL when passed invalid options flag value.
*/
#include <sys/wait.h>
#include "tst_test.h"
static siginfo_t *infop;
static void run(void)
{
TST_EXP_FAIL(waitid(P_ALL, 0, infop, WNOHANG), EINVAL);
}
static struct tst_test test = {
.test_all = run,
.bufs = (... |
google | android | waitid05 | .c | platform/external/ltp/testcases/kernel/syscalls/waitid/waitid05.c | 1,126 | utf_8 | b701ae2d3a2024374eb09b1da6b4c8ef | */
/*\
* [Description]
*
* Tests if waitid() filters children correctly by the group ID.
*
* - waitid() with GID + 1 returns ECHILD
* - waitid() with GID returns correct data
*/
#include <stdlib.h>
#include <sys/wait.h>
#include "tst_test.h"
static siginfo_t *infop;
static void run(void)
{
pid_t pid_group;
pi... |
google | android | waitid11 | .c | platform/external/ltp/testcases/kernel/syscalls/waitid/waitid11.c | 931 | utf_8 | 4062746e8823bad15a764646016565ca | */
/*\
* [Description]
*
* This test is checking if waitid() syscall recognizes a process that has been
* killed with SIGKILL.
*/
#include <time.h>
#include <stdlib.h>
#include <sys/wait.h>
#include "tst_test.h"
static siginfo_t *infop;
static void run(void)
{
pid_t pidchild;
pidchild = SAFE_FORK();
if (!pidch... |
google | android | waitid06 | .c | platform/external/ltp/testcases/kernel/syscalls/waitid/waitid06.c | 1,075 | utf_8 | 61f9ea09b93099bf752ee3d002584202 | */
/*\
* [Description]
*
* Tests if waitid() filters children correctly by the PID.
*
* - waitid() with PID + 1 returns ECHILD
* - waitid() with PID returns correct data
*/
#include <stdlib.h>
#include <sys/wait.h>
#include "tst_test.h"
static siginfo_t *infop;
static void run(void)
{
pid_t pid_child;
pid_chi... |
google | android | waitid04 | .c | platform/external/ltp/testcases/kernel/syscalls/waitid/waitid04.c | 909 | utf_8 | 117a7999c94cdb5a68e00c125f8b25ca | */
/*\
* [Description]
*
* This test if waitid() syscall leaves the si_pid set to 0 with WNOHANG flag
* when no child was waited for.
*/
#include <sys/wait.h>
#include "tst_test.h"
static siginfo_t *infop;
static void run(void)
{
pid_t pid_child;
pid_child = SAFE_FORK();
if (!pid_child) {
TST_CHECKPOINT_WAIT... |
google | android | waitid09 | .c | platform/external/ltp/testcases/kernel/syscalls/waitid/waitid09.c | 819 | utf_8 | 48d7fdaef9c5935fab2b4966b0cb7272 | */
/*\
* [Description]
*
* Test that waitid() fails with ECHILD with process that is not child of the
* current process. We fork() one child just to be sure that there are unwaited
* for children available while the test runs.
*/
#include <stdlib.h>
#include <sys/wait.h>
#include "tst_test.h"
static siginfo_t *i... |
google | android | sigtimedwait01 | .c | platform/external/ltp/testcases/kernel/syscalls/sigtimedwait/sigtimedwait01.c | 863 | utf_8 | 90389bf266b435b655706cc010c946ec | #include "libsigwait.h"
static int my_sigtimedwait(const sigset_t * set, siginfo_t * info,
void *timeout)
{
return sigtimedwait(set, info, timeout);
}
struct sigwait_test_desc tests[] = {
{ test_empty_set, SIGUSR1},
{ test_unmasked_matching, SIGUSR1},
{ test_masked_matching, SIGUSR1},
{ test_unmasked_matchin... |
google | android | clock_getres01 | .c | platform/external/ltp/testcases/kernel/syscalls/clock_getres/clock_getres01.c | 3,269 | utf_8 | 21189a0c2c04542d8e13ce6cb1b29764 | */
#include <errno.h>
#include "tst_timer.h"
#include "lapi/posix_clocks.h"
static struct test_case {
char *name;
clockid_t clk_id;
int ret;
int err;
} tcase[] = {
{"REALTIME", CLOCK_REALTIME, 0, 0},
{"MONOTONIC", CLOCK_MONOTONIC, 0, 0},
{"PROCESS_CPUTIME_ID", CLOCK_PROCESS_CPUTIME_ID, 0, 0},
{"THREAD_CPUTIME_... |
google | android | utimensat01 | .c | platform/external/ltp/testcases/kernel/syscalls/utimensat/utimensat01.c | 9,540 | utf_8 | 3618a0b1e46d3b55d7e9ed620aebb115 | *
* Basic utimnsat() test.
*/
#define _GNU_SOURCE
#include <stdio.h>
#include <time.h>
#include <errno.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <sys/stat.h>
#include "lapi/fs.h"
#include "lapi/utime.h"
#include "time64_variants.h"
#include "tst_timer.h"
#define MNTPO... |
google | android | lseek11 | .c | platform/external/ltp/testcases/kernel/syscalls/lseek/lseek11.c | 7,175 | utf_8 | 1c6fe382321d37e8d749590770b3765e | *
* Test functional SEEK_HOLE and SEEK_DATA of lseek(2).
*
* Since version 3.1, Linux supports the following additional values for
* whence:
*
* SEEK_DATA
* Adjust the file offset to the next location in the file greater than
* or equal to offset containing data. If offset points to data,
... |
google | android | lseek02 | .c | platform/external/ltp/testcases/kernel/syscalls/lseek/lseek02.c | 2,321 | utf_8 | ade9d9d166323a6437588ce5bd4306b2 | */
/*
* DESCRIPTION
* 1) lseek(2) fails and sets errno to EBADF when fd is invalid.
* 2) lseek(2) fails ans sets errno to EINVAL when whence is invalid.
* 3) lseek(2) fails and sets errno to ESPIPE when fd is associated
* with a pipe or FIFO.
*/
#include <errno.h>
#include <sys/types.h>
#include <unistd.h>
#i... |
google | android | lseek07 | .c | platform/external/ltp/testcases/kernel/syscalls/lseek/lseek07.c | 2,233 | utf_8 | 1b0b998b1b8c6046b929826e043f906a | */
/*
* Description:
* lseek() succeeds to set the specified offset according to whence
* and write valid data from this location.
*/
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include "tst_test.h"
#define TFILE1 "tfile1"
#define TFILE2 "tfile2"
#define WR_STR1 "abcdefg"
#de... |
google | android | lseek01 | .c | platform/external/ltp/testcases/kernel/syscalls/lseek/lseek01.c | 2,061 | utf_8 | ad53eac68a9043ae1eb2a6f12e587885 | */
/*
* Description:
* lseek() succeeds to set the specified offset according to whence
* and read valid data from this location.
*/
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include "tst_test.h"
#define WRITE_STR "abcdefg"
#define TFILE "tfile"
static int fd;
static stru... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.