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 | capset01 | .c | platform/external/ltp/testcases/kernel/syscalls/capset/capset01.c | 1,374 | utf_8 | 837aae77d9b50a477ed2cf67b5f12931 | */
#include <sys/types.h>
#include <unistd.h>
#include "tst_test.h"
#include "lapi/syscalls.h"
#include <linux/capability.h>
static pid_t pid;
static struct __user_cap_header_struct *header;
static struct __user_cap_data_struct *data;
static struct tcase {
int version;
char *message;
} tcases[] = {
{0x19980330, "LI... |
google | android | capset02 | .c | platform/external/ltp/testcases/kernel/syscalls/capset/capset02.c | 3,291 | utf_8 | 74594befd4b36576cc92341507bd4063 | *
* Tests basic error handling of the capset syscall.
* 1) capset() fails with errno set to EFAULT if an invalid address
* is given for header.
* 2) capset() fails with errno set to EFAULT if an invalid address
* is given for data.
* 3) capset() fails with errno set to EINVAL if an invalid value
* is given for ... |
google | android | sched_setattr01 | .c | platform/external/ltp/testcases/kernel/syscalls/sched_setattr/sched_setattr01.c | 3,198 | utf_8 | d06db37b8fef05ee81a09af0b62820e7 | /*
*/
/* Description:
* Verify that:
* 1) sched_setattr succeed with correct parameters
* 2) sched_setattr fails with unused pid
* 3) sched_setattr fails with invalid address
* 4) sched_setattr fails with invalid flag
*/
#define _GNU_SOURCE
#include <unistd.... |
google | android | fremovexattr01 | .c | platform/external/ltp/testcases/kernel/syscalls/fremovexattr/fremovexattr01.c | 2,170 | utf_8 | 7522590ff44609e2e9b043f3a821abcd | */
/*
* Test Name: fremovexattr01
*
* Description:
* Like removexattr(2), fremovexattr(2) also removes an extended attribute,
* identified by a name, from a file but, instead of using a filename path, it
* uses a descriptor. This test verifies that a simple call to fremovexattr(2)
* removes, indeed, a previousl... |
google | android | fremovexattr02 | .c | platform/external/ltp/testcases/kernel/syscalls/fremovexattr/fremovexattr02.c | 2,471 | utf_8 | 3e5ea18464934fefe11b04deb2a41934 | */
/*
* Test Name: fremovexattr02
*
* Test cases::
* 1) fremovexattr(2) fails if the named attribute does not exist.
* 2) fremovexattr(2) fails if file descriptor is not valid.
* 3) fremovexattr(2) fails if named attribute has an invalid address.
*
* Expected Results:
* fremovexattr(2) should return -1 and se... |
google | android | swapon03 | .c | platform/external/ltp/testcases/kernel/syscalls/swapon/swapon03.c | 6,300 | utf_8 | bd361a85bd254c3f8e3f79b7a77d82c6 | *
*/
/*\
* [Description]
*
* This test case checks whether swapon(2) system call returns:
* - EPERM when there are more than MAX_SWAPFILES already in use.
*/
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include <sys/wait.h>
#include "tst_test.h"
#include "lapi/syscalls.h"
#include "swaponoff.h"
#i... |
google | android | swapon02 | .c | platform/external/ltp/testcases/kernel/syscalls/swapon/swapon02.c | 2,395 | utf_8 | 607274adbbb811645ef80ebcafb6dc3d | */
/*\
* [Description]
*
* This test case checks whether swapon(2) system call returns
* 1. ENOENT when the path does not exist
* 2. EINVAL when the path exists but is invalid
* 3. EPERM when user is not a superuser
* 4. EBUSY when the specified path is already being used as a swap area
*/
#include <errno.... |
google | android | swapon01 | .c | platform/external/ltp/testcases/kernel/syscalls/swapon/swapon01.c | 1,010 | utf_8 | f95645d6ff2e5815c39acb8f0d83dd98 | */
/*\
* [Description]
*
* Checks that swapon() succeds with swapfile.
*/
#include <unistd.h>
#include <errno.h>
#include <stdlib.h>
#include "tst_test.h"
#include "lapi/syscalls.h"
#include "libswap.h"
static void verify_swapon(void)
{
TEST(tst_syscall(__NR_swapon, "./swapfile01", 0));
if (TST_RET == -1) {
ts... |
google | android | brk02 | .c | platform/external/ltp/testcases/kernel/syscalls/brk/brk02.c | 2,093 | utf_8 | a134ad6c4d548b0096d0f5a29a54b9be | */
/*\
* [Description]
*
* Expand brk() by at least 2 pages to ensure there is a newly created VMA
* and not expanding the original due to multiple anon pages. mprotect() that
* new VMA then brk() back to the original address therefore causing a munmap of
* at least one full VMA.
*/
#include <unistd.h>
#includ... |
google | android | brk01 | .c | platform/external/ltp/testcases/kernel/syscalls/brk/brk01.c | 1,502 | utf_8 | 8bfd376481a29e45f3afabc20f7f2913 | */
#include <unistd.h>
#include <stdint.h>
#include <inttypes.h>
#include <errno.h>
#include "tst_test.h"
#include "lapi/syscalls.h"
static void verify_brk(void)
{
void *cur_brk, *new_brk;
size_t inc = getpagesize() * 2 - 1;
unsigned int i;
if (tst_variant) {
tst_res(TINFO, "Testing syscall variant");
cur_brk ... |
google | android | getsockname01 | .c | platform/external/ltp/testcases/kernel/syscalls/getsockname/getsockname01.c | 4,675 | utf_8 | 0b032d05890e53625f7495e66e8f882a | /*
*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* Test Name: getsockname01
*
* Test Description:
* Verify that getsockname() returns the proper errno for various failure cases
*
* Usage: <for command-line>
* getsockname01 [-c n] [-e] [-i n] [-I x] [-P x] [-t]
* ... |
google | android | sysctl01 | .c | platform/external/ltp/testcases/kernel/syscalls/sysctl/sysctl01.c | 2,128 | utf_8 | 56cb632bd4dcf4d9ded383c316bdbb18 | */
/*
* DESCRIPTION:
* Testcase for testing the basic functionality of sysctl(2) system call.
* This testcase attempts to read the kernel parameters by using
* sysctl({CTL_KERN, KERN_* }, ...) and compares it with the known values.
*/
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <linux/versi... |
google | android | sysctl03 | .c | platform/external/ltp/testcases/kernel/syscalls/sysctl/sysctl03.c | 2,463 | utf_8 | c5460537585997a10927404582501bea | */
/*
* DESCRIPTION
* 1) Call sysctl(2) as a root user, and attempt to write data
* to the kernel_table[]. Since the table does not have write
* permissions even for the root, it should fail EPERM.
* 2) Call sysctl(2) as a non-root user, and attempt to write data
* to the kernel_table[]. Since the table... |
google | android | sysctl04 | .c | platform/external/ltp/testcases/kernel/syscalls/sysctl/sysctl04.c | 1,762 | utf_8 | edfd149bb8a9779fa42b4fb7bef8d203 | */
/*
* DESCRIPTION
* 1) Call sysctl(2) with nlen set to 0, and expect ENOTDIR.
* 2) Call sysctl(2) with nlen greater than CTL_MAXNAME, and expect ENOTDIR.
* 3) Call sysctl(2) with the address of oldname outside the address space of
* the process, and expect EFAULT.
* 4) Call sysctl(2) with the address of sol... |
google | android | nftw64 | .c | platform/external/ltp/testcases/kernel/syscalls/nftw/nftw64.c | 23,549 | utf_8 | 11eaf21b754fe3302c191725e2914e4b | /*
*
/*
* NAME
* nftw64.c - Test of nftw64()
*/
#include <pwd.h>
#include "nftw64.h"
void setup(void);
void blenter(void);
void blexit(void);
void anyfail(void);
char progname[] = "nftw64.c";
/** LTP Port **/
#define FAILED 0
#define PASSED 1
int local_flag = PASSED;
int block_number;
FILE *temp;
char *TCID = "nftw... |
google | android | test64 | .c | platform/external/ltp/testcases/kernel/syscalls/nftw/test64.c | 25,672 | utf_8 | 8ca4d844eb1bae4efcf3d2e11e6c38ca | /*
*
/*
* NAME
* test64.c - Test functions for nftw64()
*/
#include "nftw64.h"
extern int callback(const char *path);
extern pathdata pathdat[];
extern struct list mnem[], badlist[];
extern char *dirlist[NDIRLISTENTS], *goodlist[];
extern int npathdats, ngoods, nbads, nmnem, visit, s2, next_fd[4];
extern FILE ... |
google | android | lib64 | .c | platform/external/ltp/testcases/kernel/syscalls/nftw/lib64.c | 8,242 | utf_8 | e6cc54832c1054693d8befe0ff45804b | /*
*
/*
* NAME
* lib64.c - This file contains code for common failure conditions
*/
#include "nftw64.h"
extern int s2;
static char *tmp_path = "./tmp";
static const char *no_file = "./tmp/no_such_file";
static const char *is_a_file = "./tmp/is_a_file";
extern FILE *temp;
/*
* Cleanup the ./tmp
*/
void remove... |
google | android | tools | .c | platform/external/ltp/testcases/kernel/syscalls/nftw/tools.c | 5,674 | utf_8 | bcef524cc6ac54bd13fa4fc53607a017 | /*
*
/*
* NAME
* tools.c - Supporting functions for nftw.c
*/
#include "nftw.h"
extern pathdata pathdat[];
extern struct list mnem[];
extern char ebuf[ERR_BUF_SIZ];
extern int npathdats, ngoods, nbads, nmnem;
extern FILE *temp;
void fail_exit(void);
/*
* Function: void cleanup_function(void)
*
* Description:
* ... |
google | android | tools64 | .c | platform/external/ltp/testcases/kernel/syscalls/nftw/tools64.c | 5,704 | utf_8 | 07a002e6e644211c9f845933a868e2aa | /*
*
/*
* NAME
* tools64.c - Supporting functions for nftw64.c
*/
#include "nftw64.h"
extern pathdata pathdat[];
extern struct list mnem[];
extern char ebuf[ERR_BUF_SIZ];
extern int npathdats, ngoods, nbads, nmnem;
void fail_exit(void);
extern FILE *temp;
/*
* Function: void cleanup_function(void)
*
* Descriptio... |
google | android | nftw | .c | platform/external/ltp/testcases/kernel/syscalls/nftw/nftw.c | 23,504 | utf_8 | 1795644c4927aa89770ebb714a535814 | /*
*
/*
* NAME
* nftw.c - Test of nftw()
*/
#include <pwd.h>
#include "nftw.h"
void setup(void);
void blenter(void);
void blexit(void);
void anyfail(void);
char progname[] = "nftw.c";
/** LTP Port **/
#define FAILED 0
#define PASSED 1
int local_flag = PASSED;
int block_number;
FILE *temp;
char *TCID = "nftw01";
int... |
google | android | test_func64 | .c | platform/external/ltp/testcases/kernel/syscalls/nftw/test_func64.c | 13,415 | utf_8 | 181fc79dd7736a2dc9e98c52b1f7c3db | /*
*
/*
* NAME
* test_func64.c - nftw64() calls these functions.
*/
#include "nftw64.h"
extern pathdata pathdat[];
extern struct list mnem[], badlist[];
extern char *dirlist[NDIRLISTENTS];
extern const char *rw_fs_name;
extern int npathdats, ngoods, nbads, nmnem, visit, next_fd[4];
extern FILE *temp;
/*
* Calling ... |
google | android | test | .c | platform/external/ltp/testcases/kernel/syscalls/nftw/test.c | 24,978 | utf_8 | c46bc5171afb77d083f3b3eca4cd6bc2 | /*
*
/*
* NAME
* test.c - Test functions for nftw()
*/
#include "nftw.h"
extern int callback(const char *path);
extern pathdata pathdat[];
extern struct list mnem[], badlist[];
extern char *dirlist[NDIRLISTENTS], *goodlist[];
extern int npathdats, ngoods, nbads, nmnem, visit, s2, next_fd[4];
extern FILE *temp;... |
google | android | lib | .c | platform/external/ltp/testcases/kernel/syscalls/nftw/lib.c | 8,243 | utf_8 | 8b047f63fab997def5c35160e778a4b3 | /*
*
/*
* NAME
* lib.c - This file contains code for common failure conditions
*/
#include "nftw.h"
extern int s2;
static char *tmp_path = "./tmp";
static const char *no_file = "./tmp/no_such_file";
static const char *is_a_file = "./tmp/is_a_file";
extern FILE *temp;
/*
* Cleanup the ./tmp
*/
void remove_tes... |
google | android | test_func | .c | platform/external/ltp/testcases/kernel/syscalls/nftw/test_func.c | 13,143 | utf_8 | 1269854fd1041f0f44f5926d197b9980 | /*
*
/*
* NAME
* test_func.c - nftw() calls these functions.
*/
#include "nftw.h"
extern pathdata pathdat[];
extern struct list mnem[], badlist[];
extern char *dirlist[NDIRLISTENTS];
extern const char *rw_fs_name;
extern int npathdats, ngoods, nbads, nmnem, visit, next_fd[4];
extern FILE *temp;
/*
* Calling functi... |
google | android | fstat03 | .c | platform/external/ltp/testcases/kernel/syscalls/fstat/fstat03.c | 2,079 | utf_8 | 98fec2e73f92bf872135495e8bfb463e | */
/*
* Tests different error scenarios:
*
* 1) Calls fstat() with closed file descriptor
* -> EBADF
* 2) Calls fstat() with an invalid address for stat structure
* -> EFAULT (or receive signal SIGSEGV)
*/
#include <errno.h>
#include <stdlib.h>
#include <unistd.h>
#include <wait.h>
#include <sys/types.h>
... |
google | android | fstat02 | .c | platform/external/ltp/testcases/kernel/syscalls/fstat/fstat02.c | 1,377 | utf_8 | 141a5075c312f9ac9585922c2fc43cd9 | */
/*\
* [Description]
*
* Tests if fstat() returns correctly and reports correct file information
* using the stat structure.
*/
#include "tst_test.h"
#define TESTFILE "test_file"
#define LINK_TESTFILE "link_test_file"
#define FILE_SIZE 1024
#define FILE_MODE 0644
#define NLINK 2
static st... |
google | android | setfsuid01 | .c | platform/external/ltp/testcases/kernel/syscalls/setfsuid/setfsuid01.c | 861 | utf_8 | 862c0e591f6774d1b76b059acb558d97 | */
/*\
* [Description]
*
* Verify that setfsuid() correctly updates the filesystem user ID
* to the value given in fsuid argument.
*/
#include <pwd.h>
#include "tst_test.h"
#include "compat_tst_16.h"
static uid_t nobody_uid;
static void setup(void)
{
struct passwd *nobody;
nobody = SAFE_GETPWNAM("nobody");
nob... |
google | android | setfsuid02 | .c | platform/external/ltp/testcases/kernel/syscalls/setfsuid/setfsuid02.c | 811 | utf_8 | a9c8192d09e1534636263c01a685ea07 | */
/*\
* [Description]
*
* Verify that setfsuid() syscall fails if an invalid fsuid is given.
*/
#include <pwd.h>
#include "tst_test.h"
#include "compat_tst_16.h"
static void run(void)
{
uid_t invalid_uid, current_uid;
current_uid = geteuid();
invalid_uid = (UID_T)-1;
UID16_CHECK(invalid_uid, setfsuid);
TST_E... |
google | android | setfsuid04 | .c | platform/external/ltp/testcases/kernel/syscalls/setfsuid/setfsuid04.c | 4,833 | utf_8 | 90459ccc9aac481ed075109b9dbf6126 | /*****************************************************************************
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
*****************************************************************************/
/*
* Check if setfsuid behaves correctly with file permissions.
* The test creat... |
google | android | setfsuid03 | .c | platform/external/ltp/testcases/kernel/syscalls/setfsuid/setfsuid03.c | 965 | utf_8 | da818e351e9827a7844712d2fa9e01fe | /*
*/
/*\
* [Description]
*
* Verify that setfsuid() correctly updates the filesystem uid
* when caller is a non-root user and provided fsuid matches
* caller's real user ID.
*/
#include <pwd.h>
#include "tst_test.h"
#include "compat_tst_16.h"
static uid_t nobody_uid;
static void setup(void)
{
struct passwd *no... |
google | android | memcmp01 | .c | platform/external/ltp/testcases/kernel/syscalls/memcmp/memcmp01.c | 1,931 | utf_8 | b72cfaa36648d0ba9dcb2bb70b94c15d | */
/*\
* [Description]
*
* The testcase for buffer comparison by check boundary conditions.
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include "tst_test.h"
#define BSIZE 4096
#define LEN 100
char buf[BSIZE];
static struct test_case {
char *p;
char *q;
int len;
} tcases[] ... |
google | android | pwritev03 | .c | platform/external/ltp/testcases/kernel/syscalls/pwritev/pwritev03.c | 2,946 | utf_8 | e46f4b139f47d5c5324e67e33e389189 | */
/*
* Description:
* Check the basic functionality of the pwritev(2) for the file
* opened with O_DIRECT in all filesystem.
* pwritev(2) should succeed to write the expected content of data
* and after writing the file, the file offset is not changed.
*/
#define _GNU_SOURCE
#include <stdlib.h>
#include <string... |
google | android | pwritev01 | .c | platform/external/ltp/testcases/kernel/syscalls/pwritev/pwritev01.c | 2,036 | utf_8 | ae749bd5d46d1db616cb5c0c21661414 | */
/*
* Test Name: pwritev01
*
* Test Description:
* Testcase to check the basic functionality of the pwritev(2).
* pwritev(2) should succeed to write the expected content of data
* and after writing the file, the file offset is not changed.
*/
#define _GNU_SOURCE
#include <string.h>
#include <sys/uio.h>
#include "tst_... |
google | android | pwritev02 | .c | platform/external/ltp/testcases/kernel/syscalls/pwritev/pwritev02.c | 2,708 | utf_8 | 308af52ee5cec538727dd4226ef57dce | */
/*
* Test Name: pwritev02
*
* Description:
* 1) pwritev(2) fails if iov_len is invalid.
* 2) pwritev(2) fails if the vector count iovcnt is less than zero.
* 3) pwritev(2) fails if offset is negative.
* 4) pwritev(2) fails when attempts to write from a invalid address
* 5) pwritev(2) fails if file descriptor is inva... |
google | android | sched_setscheduler03 | .c | platform/external/ltp/testcases/kernel/syscalls/sched_setscheduler/sched_setscheduler03.c | 3,996 | utf_8 | b01d637198205af77e38965b6b2b9a5d | */
/*
* A regression test for can_nice call usage in sched_setscheduler,
* introduced by kernel commit:
* d50dde5a (sched: Add new scheduler syscalls to support
*
* This was fixed by below commit:
* eaad4513 (sched: Fix __sched_setscheduler() nice test
*
*/
#define _GNU_SOURCE
#include <stdio.h>
#include... |
google | android | sched_setscheduler02 | .c | platform/external/ltp/testcases/kernel/syscalls/sched_setscheduler/sched_setscheduler02.c | 1,246 | utf_8 | d9dc01d013c0b73ad6f1169b6c6958dc | */
/*\
* [Description]
*
* Testcase to test whether sched_setscheduler(2) sets the errnos
* correctly.
*
* [Algorithm]
*
* Call sched_setscheduler as a non-root uid, and expect EPERM
* to be returned.
*
*/
#include <stdlib.h>
#include <errno.h>
#include <pwd.h>
#include <sys/types.h>
#include "tst_test.h"
#... |
google | android | sched_setscheduler01 | .c | platform/external/ltp/testcases/kernel/syscalls/sched_setscheduler/sched_setscheduler01.c | 2,080 | utf_8 | 1b1b17172c51a7551c1ca7a86b38c2a4 | */
/*\
* [Description]
*
* Testcase to test whether sched_setscheduler(2) sets the errnos
* correctly.
*
* [Algorithm]
*
* 1. Call sched_setscheduler with an invalid pid, and expect
* ESRCH to be returned.
* 2. Call sched_setscheduler with an invalid scheduling policy,
* and expect EINVAL to be return... |
google | android | execl01 | .c | platform/external/ltp/testcases/kernel/syscalls/execl/execl01.c | 850 | utf_8 | 2be1fa488fa5303f43dbec4fc1feb29d | * AUTHOR : William Roske
* CO-PILOT : Dave Fenner
*/
#include <sys/types.h>
#include <sys/wait.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include "tst_test.h"
static void verify_execl(void)
{
pid_t pid;
char path[512];
if (tst_get_path("execl01_child", path, sizeof(path)))
tst_brk(TC... |
google | android | execl01_child | .c | platform/external/ltp/testcases/kernel/syscalls/execl/execl01_child.c | 465 | utf_8 | aab9397c5a397f677681285940931e41 | */
#define TST_NO_DEFAULT_MAIN
#include "tst_test.h"
int main(int argc, char *argv[])
{
tst_reinit();
if (argc != 2)
tst_brk(TFAIL, "argc is %d, expected 2", argc);
if (strcmp(argv[1], "canary"))
tst_brk(TFAIL, "argv[1] is %s, expected 'canary'", argv[1]);
tst_res(TPASS, "%s executed", argv[0]);
return 0;
} |
google | android | sendto03 | .c | platform/external/ltp/testcases/kernel/syscalls/sendto/sendto03.c | 5,638 | utf_8 | 0fd024c116c988a01cee35b8e6e2815b | * Date: Thu Sep 3 21:05:28 2020 -0700
*
* net/packet: fix overflow in tpacket_rcv
*/
#include <stdio.h>
#include <limits.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <net/if.h>
#include <net/ethernet.h>
#include "tst_test.h"
#include "tst_net.h"
#include "lapi/if_packet.h"
#... |
google | android | sendto02 | .c | platform/external/ltp/testcases/kernel/syscalls/sendto/sendto02.c | 1,842 | utf_8 | b0745ab62fe5d175a871a6402a602a2f | */
/*
* Test Name: sendto02
*
* Description:
* When sctp protocol is selected in socket(2) and buffer is invalid,
* sendto(2) should fail and set errno to EFAULT, but it sets errno
* to ENOMEM.
*
* This is a regression test and has been fixed by kernel commit:
* 6e51fe7572590d8d86e93b547fab6693d305fd0d (sctp:... |
google | android | sendto01 | .c | platform/external/ltp/testcases/kernel/syscalls/sendto/sendto01.c | 8,862 | utf_8 | 6ae6167b6f2e0840b81c165095c6e7fd | /*
*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* Test Name: sendto01
*
* Test Description:
* Verify that sendto() returns the proper errno for various failure cases
*
* HISTORY
* 07/2001 Ported by Wayne Boyer
*/
#include <stdio.h>
#include <unistd.h>
#include <er... |
google | android | timer_getoverrun01 | .c | platform/external/ltp/testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c | 2,957 | utf_8 | d3e7e7228a454f2f13859f83e574ed2e | /******************************************************************************
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
* *
******************************************************************************/... |
google | android | sched_getattr01 | .c | platform/external/ltp/testcases/kernel/syscalls/sched_getattr/sched_getattr01.c | 2,756 | utf_8 | a4fa3c2d807ec9b8615159717df212be | /*
*/
#define _GNU_SOURCE
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <linux/unistd.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <sys/syscall.h>
#include <pthread.h>
#include <errno.h>
#include "test.h"
#include "lapi/sched.h"
char *TCID =... |
google | android | sched_getattr02 | .c | platform/external/ltp/testcases/kernel/syscalls/sched_getattr/sched_getattr02.c | 2,670 | utf_8 | d3a11fc44dfa53e146b436584300ce26 | /*
*/
/* Description:
* Verify that:
* 1) sched_getattr fails with unused pid
* 2) sched_getattr fails with invalid address
* 3) sched_getattr fails with invalid value
* 4) sched_getattr fails with invalid flag
*/
#define _GNU_SOURCE
#include <unistd.h>
#inc... |
google | android | getrlimit01 | .c | platform/external/ltp/testcases/kernel/syscalls/getrlimit/getrlimit01.c | 1,378 | utf_8 | 42b526ecedead3517ebf421f632d36f7 | */
/*\
* [Description]
*
* Verify that getrlimit(2) call will be successful for all possible resource
* types.
*/
#include <sys/resource.h>
#include "tst_test.h"
static struct tcase {
int res;
char *res_str;
} tcases[] = {
#endif
};
static void verify_getrlimit(unsigned int i)
{
struct rlimit rlim;
struct tca... |
google | android | getrlimit02 | .c | platform/external/ltp/testcases/kernel/syscalls/getrlimit/getrlimit02.c | 1,128 | utf_8 | 67a9754fd4fbf797c3a943ef096d0cbe | * passed.
*/
#include <sys/resource.h>
#include "tst_test.h"
#define INVALID_RES_TYPE 1000
static struct rlimit rlim;
static struct tcase {
int exp_errno;
char *desc;
struct rlimit *rlim;
int res_type;
} tcases[] = {
{EINVAL, "invalid resource type", &rlim, INVALID_RES_TYPE}
};
static void verify_getrlimit(unsig... |
google | android | getrlimit03 | .c | platform/external/ltp/testcases/kernel/syscalls/getrlimit/getrlimit03.c | 5,509 | utf_8 | 1f08acfd73b4c8ed6e274f205392c891 | *
* Architectures may provide up to three syscalls that have been used to
* implement getrlimit(2) in different libc implementations. These syscalls
* differ in the size and signedness of rlim_t:
*
* - __NR_getrlimit uses long or unsigned long, depending on the
* architecture
*
* - __NR_ugetrlimit uses unsi... |
google | android | splice01 | .c | platform/external/ltp/testcases/kernel/syscalls/splice/splice01.c | 2,101 | utf_8 | 8c661813013f20385a74fa4f672d4711 | */
/*
* DESCRIPTION
* This test case will verify basic function of splice
* added by kernel 2.6.17 or up.
*
*/
#define _GNU_SOURCE
#include <errno.h>
#include <string.h>
#include <signal.h>
#include <sys/types.h>
#include <fcntl.h>
#include "tst_test.h"
#include "lapi/splice.h"
#define TEST_BLOCK_SIZE 1024
#defin... |
google | android | splice03 | .c | platform/external/ltp/testcases/kernel/syscalls/splice/splice03.c | 3,071 | utf_8 | dd2c02b7a02d66c0130fe5eb9a7ffda5 | */
/*
* Description:
* Verify that,
* 1) splice() returns -1 and sets errno to EBADF if the file
* descriptor fd_in is not valid.
* 2) splice() returns -1 and sets errno to EBADF if the file
* descriptor fd_out is not valid.
* 3) splice() returns -1 and sets errno to EBADF if the file
* ... |
google | android | splice02 | .c | platform/external/ltp/testcases/kernel/syscalls/splice/splice02.c | 3,350 | utf_8 | ae8cc91ffac771ab6a36aa9747e8eead | */
/*\
* [Description]
* Original reproducer for kernel fix
* bf40d3435caf NFS: add support for splice writes
* from v2.6.31-rc1.
*
* http://lkml.org/lkml/2009/4/2/55
*
* [ALGORITHM]
* - create pipe
* - fork(), child replace stdin with pipe
* - parent write to pipe
* - child slice from pipe
* - check resu... |
google | android | splice05 | .c | platform/external/ltp/testcases/kernel/syscalls/splice/splice05.c | 2,476 | utf_8 | 19a86165ca9ab181d6e4ebcf73072e04 | */
/*
* Functional test for splice(2): pipe <-> socket
*
* This test case tests splice(2) from a pipe to a socket and vice versa
*/
#define _GNU_SOURCE
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unis... |
google | android | splice04 | .c | platform/external/ltp/testcases/kernel/syscalls/splice/splice04.c | 1,906 | utf_8 | c560afe1f6094034b9d5b0c28f1dc22d | *
* Functional test for splice(2): pipe to pipe
*/
#define _GNU_SOURCE
#include <fcntl.h>
#include <stdlib.h>
#include "tst_test.h"
#include "lapi/splice.h"
#include "splice.h"
#define PIPE_MAX (64*1024)
static char *str_len_data;
static int num_len_data = PIPE_MAX;
static char *arr_in, *arr_out;
static void setup(v... |
google | android | sendfile07 | .c | platform/external/ltp/testcases/kernel/syscalls/sendfile/sendfile07.c | 1,357 | utf_8 | 829d1bfc7ad3692f77d318da53e6e382 | * 12/2007 Copyed from sendfile03.c by Masatake YAMATO
*/
/*\
* [Description]
*
* Testcase to test that sendfile(2) system call returns EAGAIN
* when passing full out_fd opened with O_NONBLOCK.
*/
#include <sys/sendfile.h>
#include "tst_test.h"
#define MAX_FILL_DATA_LENGTH 0xFFFFFFF
static int p[2];
static int in... |
google | android | sendfile04 | .c | platform/external/ltp/testcases/kernel/syscalls/sendfile/sendfile04.c | 1,856 | utf_8 | fab93dd5221ec0caa1f45658b5ade0ba | * 11/2007 Copied from sendfile02.c by Masatake YAMATO
*/
/*\
* [Description]
*
* Testcase to test that sendfile(2) system call returns EFAULT when passing
* wrong offset pointer.
*
* [Algorithm]
*
* Given wrong address or protected buffer as OFFSET argument to sendfile:
* - a wrong address is created by munm... |
google | android | sendfile06 | .c | platform/external/ltp/testcases/kernel/syscalls/sendfile/sendfile06.c | 1,652 | utf_8 | eb3736280795ccc39216cd055565c8ce | */
/*\
* [Description]
*
* Test that sendfile() system call updates file position of in_fd correctly
* when passing NULL as offset.
*/
#include <stdio.h>
#include <inttypes.h>
#include <sys/sendfile.h>
#include "tst_test.h"
#define IN_FILE "in_file"
#define OUT_FILE "out_file"
static struct stat sb;
static void s... |
google | android | sendfile03 | .c | platform/external/ltp/testcases/kernel/syscalls/sendfile/sendfile03.c | 1,246 | utf_8 | a9e0359b2635707eebcddd69332d73d4 | * 07/2001 Ported by Wayne Boyer
*/
/*\
* [Description]
*
* Testcase to test that sendfile(2) system call returns EBADF when passing
* wrong out_fd or in_fd.
*
* There are four cases:
*
* - in_fd == -1
* - out_fd = -1
* - in_fd opened with O_WRONLY
* - out_fd opened with O_RDONLY
*/
#include <sys/sendfile.... |
google | android | sendfile09 | .c | platform/external/ltp/testcases/kernel/syscalls/sendfile/sendfile09.c | 2,687 | utf_8 | bb27397e1ed0142d392ec3d1d2d7521e | */
/*\
* [Description]
*
* Testcase copied from sendfile02.c to test the basic functionality of
* the sendfile() system call on large file. There is a kernel bug which
* introduced by commit 8f9c0119d7ba9 and fixed by commit 5d73320a96fcc.
*
* Only supports 64bit systems.
*
* [Algorithm]
*
* 1. Call sendfil... |
google | android | sendfile05 | .c | platform/external/ltp/testcases/kernel/syscalls/sendfile/sendfile05.c | 978 | utf_8 | f6e687a1c1a9e4b6d62db47f06f8dc98 | * 11/2007 Copyed from sendfile02.c by Masatake YAMATO
*/
/*\
* [Description]
*
* Testcase to test that sendfile(2) system call returns EINVAL when passing
* negative offset.
*
* [Algorithm]
*
* Call sendfile with offset = -1.
*/
#include <sys/sendfile.h>
#include "tst_test.h"
static int in_fd;
static int out... |
google | android | sendfile02 | .c | platform/external/ltp/testcases/kernel/syscalls/sendfile/sendfile02.c | 2,322 | utf_8 | a3363a57eaf7070c729413f96ca0acd3 | */
/*\
* [Description]
*
* Test the basic functionality of the sendfile() system call:
*
* 1. Call sendfile() with offset = 0.
* 2. Call sendfile() with offset in the middle of the file.
*/
#include <stdio.h>
#include <inttypes.h>
#include <sys/sendfile.h>
#include "tst_test.h"
#define IN_FILE "in_file"
#define... |
google | android | sendfile08 | .c | platform/external/ltp/testcases/kernel/syscalls/sendfile/sendfile08.c | 1,779 | utf_8 | abeb2973374372a48777b23996ca1d9c | */
/*\
* [Description]
*
* Bug in the splice code has caused the file position on the write side
* of the sendfile system call to be incorrectly set to the read side file
* position. This can result in the data being written to an incorrect offset.
*
* This is a regression test for kernel commit 2cb4b05e76478.
... |
google | android | memcpy01 | .c | platform/external/ltp/testcases/kernel/syscalls/memcpy/memcpy01.c | 1,646 | utf_8 | 3697fca40e6db11408406c2a395c890c | */
/*\
* [Description]
*
* The testcase for buffer copy by check boundary conditions.
*/
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include "tst_test.h"
#define BSIZE 4096
#define LEN 100
char buf[BSIZE];
static void clearit(void)
{
register int i;
for (i =... |
google | android | renameat01 | .c | platform/external/ltp/testcases/kernel/syscalls/renameat/renameat01.c | 6,945 | utf_8 | 5a0e2d842520b8c08db97143027162ad | /*
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* Description:
* Verify that,
* 1) renameat(2) returns -1 and sets errno to EBADF if olddirfd
* or newdirfd is not a valid file descriptor.
* 2) renameat(2) returns -1 and sets errno to ENOTDIR if oldpath
* is relative a... |
google | android | pidfd_send_signal01 | .c | platform/external/ltp/testcases/kernel/syscalls/pidfd_send_signal/pidfd_send_signal01.c | 2,265 | utf_8 | af617c1838596917aaed8cceabfbf9e4 | */
/*\
* [Description]
*
* Tests if the pidfd_send_signal syscall behaves
* like rt_sigqueueinfo when a pointer to a siginfo_t
* struct is passed.
*/
#define _GNU_SOURCE
#include <signal.h>
#include <stdlib.h>
#include "tst_test.h"
#include "lapi/pidfd.h"
#include "tst_safe_pthread.h"
#define SIGNAL SIGUSR1
#de... |
google | android | pidfd_send_signal03 | .c | platform/external/ltp/testcases/kernel/syscalls/pidfd_send_signal/pidfd_send_signal03.c | 3,200 | utf_8 | c06139e4d4e2b3a3aa9e7ce077378afc | */
/*\
* [Description]
*
* This test checks if the pidfd_send_signal syscall wrongfully sends
* a signal to a new process which inherited the PID of the actual
* target process.
*
* In order to do so it is necessary to start a process with a pre-
* determined PID. This is accomplished by writing to the
* /pro... |
google | android | pidfd_send_signal02 | .c | platform/external/ltp/testcases/kernel/syscalls/pidfd_send_signal/pidfd_send_signal02.c | 2,419 | utf_8 | 10b7349c82ec41c516ed1fb4a49df23c | */
/*\
* [Description]
*
* Tests basic error handling of the pidfd_send_signal
* system call.
*
* - EINVAL Pass invalid flag value to syscall (value chosen
* to be unlikely to collide with future extensions)
* - EBADF Pass a file descriptor that is corresponding to a
* regular file instead of a pid direct... |
google | android | init_module01 | .c | platform/external/ltp/testcases/kernel/syscalls/init_module/init_module01.c | 1,038 | utf_8 | 6ca4d6c0915804e7d670a5ce59828ba3 | */
/*\
* [Description]
*
* Basic init_module() tests.
*
* [Algorithm]
*
* Inserts a simple module after opening and mmaping the module file.
*/
#include <errno.h>
#include "lapi/init_module.h"
#include "tst_module.h"
#define MODULE_NAME "init_module.ko"
static struct stat sb;
static void *buf;
static void setu... |
google | android | init_module | .c | platform/external/ltp/testcases/kernel/syscalls/init_module/init_module.c | 749 | utf_8 | 3ee63dd14ad87f4de0eec5116129a97e | *
* Dummy test module.
*
* The module accepts a single argument named "status" and it fails
* initialization if the status is set to "invalid".
*/
#include <linux/module.h>
#include <linux/init.h>
#include <linux/proc_fs.h>
#include <linux/kernel.h>
static char status[20];
module_param_string(status, status, 20, ... |
google | android | init_module02 | .c | platform/external/ltp/testcases/kernel/syscalls/init_module/init_module02.c | 2,369 | utf_8 | 20462e86930c1780707e75a16021c800 | */
/*\
* [Description]
*
* Basic init_module() failure tests.
*
* [Algorithm]
*
* Tests various failure scenarios for init_module().
*/
#include <linux/capability.h>
#include <errno.h>
#include "lapi/init_module.h"
#include "tst_module.h"
#include "tst_capability.h"
#define MODULE_NAME "init_module.ko"
static ... |
google | android | timer_create03 | .c | platform/external/ltp/testcases/kernel/syscalls/timer_create/timer_create03.c | 1,731 | utf_8 | 5ea590cf4a8f52800251be5942a7ac82 | */
/*
* Regression test for CVE-2017-18344:
*
* In kernels prior to 4.14.8 sigevent.sigev_notify is not
* properly verified when calling timer_create(2) with the
* field being set to (SIGEV_SIGNAL | SIGEV_THREAD_ID).
* This can be used to read arbitrary kernel memory.
*
* For more info see: https://nvd.nist.go... |
google | android | timer_create01 | .c | platform/external/ltp/testcases/kernel/syscalls/timer_create/timer_create01.c | 2,408 | utf_8 | 111cd4f50ab7b132e57df572cd1e7c45 | */
/*
*
* Basic test for timer_create(2):
*
* Creates a timer for each available clock using the
* following notification types:
* 1) SIGEV_NONE
* 2) SIGEV_SIGNAL
* 3) SIGEV_THREAD
* 4) SIGEV_THREAD_ID
* 5) NULL
*
* This is also regression test for commit:
* f18ddc13af98 ("alarmtimer: Use EOPNOTSUPP inste... |
google | android | timer_create02 | .c | platform/external/ltp/testcases/kernel/syscalls/timer_create/timer_create02.c | 2,315 | utf_8 | 384de2c6f63bdd7681ee466cb0a5a1ee | */
/*
* Basic error handling test for timer_create(2):
*
* Passes invalid parameters when calling the syscall and checks
* if it fails with EFAULT/EINVAL:
* 1) Pass an invalid pointer for the sigevent structure parameter
* 2) Pass an invalid pointer for the timer ID parameter
* 3) Pass invalid clock type
* 4) ... |
google | android | linkat02 | .c | platform/external/ltp/testcases/kernel/syscalls/linkat/linkat02.c | 4,906 | utf_8 | 265660bd38fc133efcc351262221d927 | /*
* with this program.
*/
/*
* Test that linkat() fails and sets the proper errno values.
*/
#define _GNU_SOURCE
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <signal.h>
#include <pwd.h>
#include <sys/mount.h>
#include "test.h"
... |
google | android | linkat01 | .c | platform/external/ltp/testcases/kernel/syscalls/linkat/linkat01.c | 8,749 | utf_8 | 8448815e4642f26b27d919d51d3cd0a2 | /******************************************************************************
*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* NAME
* linkat01.c
*
* DESCRIPTION
* This test case will verify basic function of linkat
* added by kernel 2.6.16 or up.
*
* USAGE: <for ... |
google | android | removexattr01 | .c | platform/external/ltp/testcases/kernel/syscalls/removexattr/removexattr01.c | 2,535 | utf_8 | 9fd059e7918c0d7532b7bbeb39e4c6e5 | /*
* alone with this program.
*/
/*
* Test Name: removexattr01
*
* Description:
* The testcase checks the basic functionality of the removexattr(2).
* removexattr(2) removes the extended attribute identified by
* name and associated with the given path in the filesystem.
*/
#include "config.h"
#include <errno.h>
#inclu... |
google | android | removexattr02 | .c | platform/external/ltp/testcases/kernel/syscalls/removexattr/removexattr02.c | 2,743 | utf_8 | 2199d9c9433a04a65dc02d5865a8179f | /*
* alone with this program.
*/
/*
* Test Name: removexattr02
*
* Description:
* 1) removexattr(2) fails if the named attribute does not exist.
* 2) removexattr(2) fails if path is an empty string.
* 3) removexattr(2) fails when attempted to read from a invalid address.
*
* Expected Result:
* 1) removexattr(2) should ... |
google | android | get_robust_list01 | .c | platform/external/ltp/testcases/kernel/syscalls/get_robust_list/get_robust_list01.c | 4,708 | utf_8 | 860689c1bcb8cba94a4f4be229e29f22 | /*
*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* Test Name: get_robust_list01
*
* Test Description:
* Verify that get_robust_list() returns the proper errno for various failure
* cases
*
* Usage: <for command-line>
* get_robust_list01 [-c n] [-e][-i n] [-I x] ... |
google | android | chmod01 | .c | platform/external/ltp/testcases/kernel/syscalls/chmod/chmod01.c | 1,599 | utf_8 | b334c4dd8fc9f30377b272e670cb7754 | * 07/2001 Ported by Wayne Boyer
*/
/*\
* [Description]
*
* Verify that chmod(2) succeeds when used to change the mode permissions
* of a file or directory.
*/
#include "tst_test.h"
#define MODE S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH
#define TESTFILE "testfile"
#define TESTDIR "testdir_1"
static int modes[] = {0... |
google | android | chmod03 | .c | platform/external/ltp/testcases/kernel/syscalls/chmod/chmod03.c | 1,755 | utf_8 | 5b6a7cf4e8cc6bbf5bcd1b81f7cc560a | * 07/2001 Ported by Wayne Boyer
*/
/*\
* [Description]
*
* Verify that, chmod(2) will succeed to change the mode of a file or directory
* and set the sticky bit on it if invoked by non-root (uid != 0)
* process with the following constraints:
*
* - the process is the owner of the file or directory.
* - the e... |
google | android | chmod07 | .c | platform/external/ltp/testcases/kernel/syscalls/chmod/chmod07.c | 2,201 | utf_8 | f40c57b23b949383b490eb67ad4628a3 | */
/*
* Test Name: chmod07
*
* Test Description:
* Verify that, chmod(2) will succeed to change the mode of a file/directory
* and sets the sticky bit on it if invoked by root (uid = 0) process with
* the following constraints,
* - the process is not the owner of the file/directory.
* - the effective group ... |
google | android | chmod05 | .c | platform/external/ltp/testcases/kernel/syscalls/chmod/chmod05.c | 2,434 | utf_8 | b0891cc607e87c32cb5d51d2b8604e26 | */
/*
* Test Name: chmod05
*
* Test Description:
* Verify that, chmod(2) will succeed to change the mode of a directory
* but fails to set the setgid bit on it if invoked by non-root (uid != 0)
* process with the following constraints,
* - the process is the owner of the directory.
* - the effective group I... |
google | android | chmod06 | .c | platform/external/ltp/testcases/kernel/syscalls/chmod/chmod06.c | 3,620 | utf_8 | e01e22a82b2625e94310a479dfae1c0b | */
/*
* Test Name: chmod06
*
* Test Description:
* Verify that,
* 1) chmod(2) returns -1 and sets errno to EPERM if the effective user id
* of process does not match the owner of the file and the process is
* not super user.
* 2) chmod(2) returns -1 and sets errno to EACCES if search permission is
* den... |
google | android | symlink05 | .c | platform/external/ltp/testcases/kernel/syscalls/symlink/symlink05.c | 4,342 | utf_8 | 71db923195ff05b39058cc1604dea2b5 | /*
*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* Test Name : symlink05
*
* Test Description :
* Verify that, symlink will succeed to creat a symbolic link of an
* non-existing object name path.
*
* Expected Result:
* symlink() should return value 0 on success a... |
google | android | symlink04 | .c | platform/external/ltp/testcases/kernel/syscalls/symlink/symlink04.c | 4,847 | utf_8 | 61b8cf7b2ec5b96a28be6be2ea1cde4d | /*
*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* Test Name : symlink04
*
* Test Description :
* Verify that, symlink will succeed to creat a symbolic link of an existing
* object name path.
*
* Expected Result:
* symlink() should return value 0 on success and s... |
google | android | symlink03 | .c | platform/external/ltp/testcases/kernel/syscalls/symlink/symlink03.c | 9,691 | utf_8 | ca06c921009fad3f2c1586c4d5369ac3 | /*
*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* Test Name : symlink03
*
* Test Description :
* Verify that,
* 1) symlink(2) returns -1 and sets errno to EACCES if search/write
* permission is denied in the directory where the symbolic link is
* being created.
... |
google | android | symlink01 | .c | platform/external/ltp/testcases/kernel/syscalls/symlink/symlink01.c | 62,328 | utf_8 | 1c5c2c6484d578bf82af6d4a751cd3de | /*
* 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 | symlink02 | .c | platform/external/ltp/testcases/kernel/syscalls/symlink/symlink02.c | 5,518 | utf_8 | 5add9af0e8ff920595c14be16641b37b | /*
* 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 | kill02 | .c | platform/external/ltp/testcases/kernel/syscalls/kill/kill02.c | 26,127 | utf_8 | 2abe656d9abf59f2fb1cb9d5bda4e56d | /*
* 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 | kill07 | .c | platform/external/ltp/testcases/kernel/syscalls/kill/kill07.c | 5,305 | utf_8 | 1335d2a6472cd554a87995ea45b9e34b | /*
*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* NAME
* kill07.c
*
* DESCRIPTION
* Test case to check that SIGKILL can not be caught.
*
* ALGORITHM
* call setup
* setup some shared memory
* loop if the -i option was given
* set up to catch SIGKILL
* if SIGKIL... |
google | android | kill05 | .c | platform/external/ltp/testcases/kernel/syscalls/kill/kill05.c | 2,111 | utf_8 | a5aa893dbfece524f1a422e8726ee6da | * - Fix wrong return value check on shmat system call (leading to
* segfault in case of error with this syscall).
* - Fix deletion of IPC memory segment. Segment was not correctly
* deleted due to the change of uid during the test.
*
* RESTRICTIONS
* This test must be run as root.
*/
#in... |
google | android | kill11 | .c | platform/external/ltp/testcases/kernel/syscalls/kill/kill11.c | 2,701 | utf_8 | 449330657db95037cd0a96183d5343bc | *
* Test checks that when a child is killed by its parent with sig, it
* returns the correct values(sig and core dump bit) to the waiting parent.
*
* RESTRICTIONS
* The ulimit for core file size must be greater than 0.
*/
#define _GNU_SOURCE
#include <errno.h>
#include <sys/types.h>
#include <signal.h>
#include ... |
google | android | kill06 | .c | platform/external/ltp/testcases/kernel/syscalls/kill/kill06.c | 993 | utf_8 | da5f342c6a1844673ba9c244e41d2b3a | *
* Test case to check the basic functionality of kill() when killing an
* entire process group with a negative pid.
*
* HISTORY
* 07/2001 Ported by Wayne Boyer
*/
#include <sys/types.h>
#include <signal.h>
#include <sys/wait.h>
#include <unistd.h>
#include <stdlib.h>
#include "tst_test.h"
static void verify_kil... |
google | android | kill12 | .c | platform/external/ltp/testcases/kernel/syscalls/kill/kill12.c | 5,251 | utf_8 | 98fe75b9e0d6813e90d27b62ac270f9f | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*kill2.c */
/*======================================================================
>KEYS: < kill(), wait(), signal()
>WHAT: < Check that when a child is killed by its parent, it returns the
< correct values to the waiting ... |
google | android | kill08 | .c | platform/external/ltp/testcases/kernel/syscalls/kill/kill08.c | 4,006 | utf_8 | 040982139bbb1e129b5bf65d074bf194 | /*
*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* NAME
* kill08.c
*
* DESCRIPTION
* Test case to check the basic functionality of kill() when kill an
* entire process group.
*
* ALGORITHM
* call setup
* loop if the -i option was given
* fork 5 childeren
* execu... |
google | android | kill13 | .c | platform/external/ltp/testcases/kernel/syscalls/kill/kill13.c | 1,223 | utf_8 | 5c20a239f485549a30647d2522c66430 | */
/*\
* [Description]
*
* Reproducer of CVE-2018-10124; INT_MIN negation.
*
* On most two's complement CPUs negation of INT_MIN will result in
* INT_MIN because ~((unsigned)INT_MIN) + 1 overflows to INT_MIN
* (unless trapped). On one's complement ~((unsigned)INT_MIN) = INT_MAX.
*
* Without UBSAN kill will al... |
google | android | kill03 | .c | platform/external/ltp/testcases/kernel/syscalls/kill/kill03.c | 1,299 | utf_8 | 6267101754b21e2a252ff32cf8d96890 | *
* 1) kill() fails with errno set to EINVAL if given an invalid signal.
* 2) kill() fails with errno set to ESRCH if given a non-existent pid.
* 3) kill() fails with errno set to ESRCH if the given pid is INT_MIN.
*
* HISTORY
* 07/2001 Ported by Wayne Boyer
*/
#include <sys/types.h>
#include <signal.h>
#includ... |
google | android | kill09 | .c | platform/external/ltp/testcases/kernel/syscalls/kill/kill09.c | 4,591 | utf_8 | 6ab761700eda43447708a485bf1f5ac8 | /*
* 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 | kill10 | .c | platform/external/ltp/testcases/kernel/syscalls/kill/kill10.c | 20,809 | utf_8 | 06944a0fd8529978abc65d9dd89e555d | /*
* 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 | pause03 | .c | platform/external/ltp/testcases/kernel/syscalls/pause/pause03.c | 2,392 | utf_8 | 638684b26b3a4e313c3dacf0ddbe966c | /*
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* Test Description:
* pause() does not return due to receipt of SIGKILL signal and specified
* process should be terminated.
*/
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/wait.h>
#include "test.h"
#include "... |
google | android | pause02 | .c | platform/external/ltp/testcases/kernel/syscalls/pause/pause02.c | 3,338 | utf_8 | c9bd4d15b48eb595424d3aab6afa0220 | /*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* Verify that, pause() returns -1 and sets errno to EINTR after receipt of a
* signal which is caught by the calling process. Also, verify that the calling
* process will resume execution from the point of suspension.
*/
#incl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.