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 | rename04 | .c | platform/external/ltp/testcases/kernel/syscalls/rename/rename04.c | 1,125 | utf_8 | add5b585a3d4028ed2131980200c9692 | */
/*\
* [Description]
*
* Verify that rename() fails with EEXIST or ENOTEMPTY when
* newpath is a non-empty directory.
*/
#include <stdio.h>
#include "tst_test.h"
#define MNT_POINT "mntpoint"
#define DIR1 "dir1"
#define DIR2 "dir2"
#define TEMP_FILE DIR2"/tmpfile"
static void setup(void)
{
SAFE_CHDIR(MNT_POINT)... |
google | android | mknodat01 | .c | platform/external/ltp/testcases/kernel/syscalls/mknodat/mknodat01.c | 3,802 | utf_8 | fc18f80a0166e019eee931be0ef22cfe | /******************************************************************************
*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* DESCRIPTION
* This test case will verify basic function of mknodat
* added by kernel 2.6.16 or up.
*
********************************************... |
google | android | mknodat02 | .c | platform/external/ltp/testcases/kernel/syscalls/mknodat/mknodat02.c | 4,398 | utf_8 | b88a71a71bbfb909be9a9b8783e0ea5b | /*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/*
* Description:
* Verify that,
* 1) mknod(2) returns -1 and sets errno to EROFS if pathname refers to
* a file on a read-only file system.
* 2) mknod(2) returns -1 and sets errno to ELOOP if Too many symbolic
* links were encountere... |
google | android | close_range02 | .c | platform/external/ltp/testcases/kernel/syscalls/close_range/close_range02.c | 2,366 | utf_8 | 00642fd080cb910028151a6e38d03250 | */
/*\
* [Description]
*
* - First check close_range works on a valid range.
* - Then check close_range does not accept invalid paramters.
* - Then check it accepts a large lower fd.
* - Finally check CLOEXEC works
*
*/
#include <stdlib.h>
#include "tst_test.h"
#include "tst_clone.h"
#include "lapi/fcntl.h"
#i... |
google | android | close_range01 | .c | platform/external/ltp/testcases/kernel/syscalls/close_range/close_range01.c | 4,261 | utf_8 | b9f4f324d0bd8ccd5680e5cb46ab5e5c | */
/*\
* [Description]
*
* We check that close_range()
*
* - closes FDs
* - UNSHARES some FDs before closing them
* - it sets CLOEXEC (in both cloned process and parent)
* - combination of CLOEXEC and UNSHARE.
*
* The final test is the actual bug reproducer. Note that we call
* clone directly to share the f... |
google | android | acct02_helper | .c | platform/external/ltp/testcases/kernel/syscalls/acct/acct02_helper.c | 235 | utf_8 | 3f20eae054095d772959a00d18d68ca4 | */
/*
* Dummy program used in acct02
*/
#include <unistd.h>
int main(void)
{
sleep(1);
return 128;
} |
google | android | acct01 | .c | platform/external/ltp/testcases/kernel/syscalls/acct/acct01.c | 3,085 | utf_8 | 144e8af73ab2beca7d0c3b1a94f34c67 | /*\
* [DOCUMENTATION]
* Verify that acct() returns proper errno on failure.
*/
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include <fcntl.h>
#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/mount.h>
#include "tst_test.h"
#define DIR_MODE (S_IRUSR|S_IWUSR|... |
google | android | acct02 | .c | platform/external/ltp/testcases/kernel/syscalls/acct/acct02.c | 6,145 | utf_8 | 36be0ca69fb74ea675f167da855d214f | */
/*\
* [DOCUMENTATION]
*
* This tests if the kernel writes correct data to the
* process accounting file.
*
* First, system-wide process accounting is turned on and the output gets
* directed to a defined file. After that a dummy program is run in order
* to generate data and the process accounting gets turn... |
google | android | chown02 | .c | platform/external/ltp/testcases/kernel/syscalls/chown/chown02.c | 1,857 | utf_8 | 59555ed79de1588a871a99a24b10fae3 | */
/*\
* [Description]
*
* Verify that chown(2) invoked by super-user:
* - clears setuid and setgid bits set on an executable file
* - preserves setgid bit set on a non-group-executable file
*/
#include "tst_test.h"
#include "compat_tst_16.h"
#include "tst_safe_macros.h"
#define NEW_PERMS1 (S_IFREG|S_IRWXU|S_I... |
google | android | chown04 | .c | platform/external/ltp/testcases/kernel/syscalls/chown/chown04.c | 3,213 | utf_8 | fb7ffd881ae90e48768adcffbb8df4fd | */
/*\
* [Description]
*
* Verify that:
*
* 1. Chown() 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. Chown() returns -1 and sets errno to EACCES if search permission is
* denied on a component of... |
google | android | chown05 | .c | platform/external/ltp/testcases/kernel/syscalls/chown/chown05.c | 1,593 | utf_8 | 4ace52cb238375b99c4715ed790ea041 | */
/*\
* [Description]
*
* Verify that, chown(2) succeeds to change the owner and group of a file
* specified by path to any numeric owner(uid)/group(gid) values when invoked
* by super-user.
*/
#include "tst_test.h"
#include "compat_tst_16.h"
#include "tst_safe_macros.h"
#define FILE_MODE (S_IFREG|S_IRUSR|S_IWU... |
google | android | chown01 | .c | platform/external/ltp/testcases/kernel/syscalls/chown/chown01.c | 785 | utf_8 | 88f8696c99c0c29a9e7e3b0ebbf92bdc | */
/*\
* [Description]
*
* Basic test for chown(). Calls chown() on a file and expects it to pass.
*/
#include "tst_test.h"
#include "compat_tst_16.h"
#define FILENAME "chown01_testfile"
static int uid, gid;
static void run(void)
{
TST_EXP_PASS(CHOWN(FILENAME, uid, gid), "chown(%s,%d,%d)",
FILENAME, uid, g... |
google | android | chown03 | .c | platform/external/ltp/testcases/kernel/syscalls/chown/chown03.c | 2,293 | utf_8 | c12616cdfbc376de74d7c1e6a24eea3d | * 07/2001 Ported by Wayne Boyer
*/
/*\
* [Description]
*
* Verify that, chown(2) succeeds to change the group of a file specified
* by path when called by non-root user with the following constraints:
*
* - euid of the process is equal to the owner of the file.
* - the intended gid is either egid, or one of th... |
google | android | socketpair02 | .c | platform/external/ltp/testcases/kernel/syscalls/socketpair/socketpair02.c | 1,790 | utf_8 | aeb5808bdf1b4501620dc8879817eac5 | */
/*
* Test Name: socketpair02
*
* Description:
* This Program tests the new flag SOCK_CLOEXEC and SOCK_NONBLOCK introduced
* in socketpair() in kernel 2.6.27.
*/
#include <errno.h>
#include <pthread.h>
#include <stdio.h>
#include <unistd.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/syscall.h>
#inc... |
google | android | socketpair01 | .c | platform/external/ltp/testcases/kernel/syscalls/socketpair/socketpair01.c | 1,860 | utf_8 | be047d64525025ccd16fc30374a90b4d | */
/*
* Test Name: socketpair01
*
* Test Description:
* Verify that socketpair() returns the proper errno for various failure cases
*/
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <netinet/in.h>
#include "tst_test.h"
static int fds... |
google | android | wait402 | .c | platform/external/ltp/testcases/kernel/syscalls/wait4/wait402.c | 2,241 | utf_8 | 43c5f775cb9b467a93cdf54ef6ecf19c | /*
*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* wait402 - check for ECHILD errno when using an illegal pid value
*/
#include "test.h"
#include <errno.h>
#include <sys/types.h>
#include <sys/resource.h>
#include <sys/wait.h>
#include <stdlib.h>
#include <string.h>
ch... |
google | android | wait403 | .c | platform/external/ltp/testcases/kernel/syscalls/wait4/wait403.c | 934 | utf_8 | e0ca92af9ba876f5487794983b25d66b | */
/*\
* [Description]
*
* Check wait4(INT_MIN, ...) is not allowed. The pid is negated before
* searching for a group with that pid. Negating INT_MIN is not
* defined so UBSAN will be triggered if enabled. Also see kill13.
*
* If the bug is present, but UBSAN is not enabled, then it should
* result in ECHILD.... |
google | android | wait401 | .c | platform/external/ltp/testcases/kernel/syscalls/wait4/wait401.c | 1,264 | utf_8 | 2cede7ce29d5be1839333cd43e7360fd | #include <sys/types.h>
#include <sys/resource.h>
#include <sys/wait.h>
#include "tst_test.h"
static void run(void)
{
pid_t pid;
int status = 1;
struct rusage rusage;
pid = SAFE_FORK();
if (!pid) {
TST_PROCESS_STATE_WAIT(getppid(), 'S', 0);
exit(0);
}
TST_EXP_PID_SILENT(wait4(pid, &status, 0, &rusage), "wait4... |
google | android | memset01 | .c | platform/external/ltp/testcases/kernel/syscalls/memset/memset01.c | 1,215 | utf_8 | 7094452a0218fe72c986cf6f44c3f527 | */
/*\
* [Description]
*
* The testcase for test setting of buffer by check boundary conditions.
*/
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
#include "tst_test.h"
#define BSIZE 4096
char buf[BSIZE];
static void fill(void)
{
register int i;
for (i = 0; i < ... |
google | android | userfaultfd01 | .c | platform/external/ltp/testcases/kernel/syscalls/userfaultfd/userfaultfd01.c | 2,683 | utf_8 | 4d93719aabb6f3b9ddff053106fad896 | *
* Test userfaultfd
*
* Force a pagefault event and handle it using userfaultfd
* from a different thread
*/
#include "config.h"
#include "tst_test.h"
#include <poll.h>
#include "tst_safe_macros.h"
#include "tst_safe_pthread.h"
#include "lapi/userfaultfd.h"
static int page_size;
static char *page;
static void *c... |
google | android | pselect01 | .c | platform/external/ltp/testcases/kernel/syscalls/pselect/pselect01.c | 705 | utf_8 | 904c2fa0b0a8a49073216749d399d31d | */
#include <sys/select.h>
#include <sys/time.h>
#include <sys/types.h>
#include <errno.h>
#include "tst_timer_test.h"
int sample_fn(int clk_id, long long usec)
{
fd_set readfds;
struct timespec tv = tst_timespec_from_us(usec);
FD_ZERO(&readfds);
FD_SET(0, &readfds);
tst_timer_start(clk_id);
TEST(pselect(0, &rea... |
google | android | pselect03 | .c | platform/external/ltp/testcases/kernel/syscalls/pselect/pselect03.c | 973 | utf_8 | 76b32deb31c9078c07b1fa8538a49fdc | */
/*
* This is basic test for pselect() returning without error.
*/
#include <stdio.h>
#include <fcntl.h>
#include <sys/select.h>
#include <sys/time.h>
#include <sys/types.h>
#include <time.h>
#include <unistd.h>
#include <errno.h>
#include "tst_test.h"
static int fd;
static void verify_pselect(void)
{
fd_set r... |
google | android | pselect02 | .c | platform/external/ltp/testcases/kernel/syscalls/pselect/pselect02.c | 1,219 | utf_8 | 5f6f577ba32d033809e7a78dab5d1159 | */
/*\
* [Description]
*
* Verify that pselect() fails with:
*
* - EBADF if a file descriptor that was already closed
* - EINVAL if nfds was negative
* - EINVAL if the value contained within timeout was invalid
*/
#include "tst_test.h"
static fd_set read_fds;
static struct timespec time_buf;
static struct ... |
google | android | move_mount02 | .c | platform/external/ltp/testcases/kernel/syscalls/move_mount/move_mount02.c | 2,329 | utf_8 | f7a7f362165b245ee7f262cbced65ac4 | *
* Basic move_mount() failure tests.
*/
#include "tst_test.h"
#include "lapi/fsmount.h"
#define MNTPOINT "mntpoint"
int invalid_fd = -1, fsmfd;
static struct tcase {
char *name;
int *from_dirfd;
const char *from_pathname;
int to_dirfd;
const char *to_pathname;
unsigned int flags;
int exp_errno;
} tcases[] = ... |
google | android | move_mount01 | .c | platform/external/ltp/testcases/kernel/syscalls/move_mount/move_mount01.c | 1,898 | utf_8 | f7bb6c49f8d7fdf8ae7d9b9a3f5d0af0 | *
* Basic move_mount() test.
*/
#include "tst_test.h"
#include "lapi/fsmount.h"
#define MNTPOINT "mntpoint"
#define TCASE_ENTRY(_flags) {.name = "Flag " #_flags, .flags = _flags}
static struct tcase {
char *name;
unsigned int flags;
} tcases[] = {
TCASE_ENTRY(MOVE_MOUNT_F_SYMLINKS),
TCASE_ENTRY(MOVE_MOUNT_F_AUTO... |
google | android | exit02 | .c | platform/external/ltp/testcases/kernel/syscalls/exit/exit02.c | 1,315 | utf_8 | 1b9aa2a3c9db5c61ed6ca4363dd4190c | */
/*
* Fork a process that creates a file and writes a few bytes, and
* calls exit WITHOUT calling close(). The parent then reads the
* file. If everything that was written is present in the file, then
* the test passes.
*/
#include <stdlib.h>
#include "tst_test.h"
#define FNAME "test_file"
static void child_wr... |
google | android | exit01 | .c | platform/external/ltp/testcases/kernel/syscalls/exit/exit01.c | 2,445 | utf_8 | bfa48cfd3928b4f54d8f1c8e58ab7545 | /*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* Check that exit returns the correct values to the waiting parent
*/
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/stat.h>
#include <stdio.h>
#include <signal.h>
#include <errno.h>
#include "test.h"
static void cle... |
google | android | name_to_handle_at01 | .c | platform/external/ltp/testcases/kernel/syscalls/name_to_handle_at/name_to_handle_at01.c | 3,277 | utf_8 | 1c5b8fcdf585b636e9a3fc1b4729b7f3 | */
/*\
* [Description]
*
* Basic name_to_handle_at() tests.
*
* [Algorithm]
* - Check that EOVERFLOW is returned as expected by name_to_handle_at().
* - Check that we were able to access a file's stat with name_to_handle_at()
* and open_by_handle_at().
*/
#define _GNU_SOURCE
#include <sys/stat.h>
#includ... |
google | android | name_to_handle_at02 | .c | platform/external/ltp/testcases/kernel/syscalls/name_to_handle_at/name_to_handle_at02.c | 2,414 | utf_8 | 5b2755fb7145c23d0110b5c8f7398fc2 | */
/*\
* [Description]
*
* Failure tests for name_to_handle_at().
*/
#define _GNU_SOURCE
#include "lapi/name_to_handle_at.h"
#define TEST_FILE "test_file"
static struct file_handle fh, high_fh = {.handle_bytes = MAX_HANDLE_SZ + 1};
static struct file_handle *valid_fhp = &fh, *invalid_fhp, *high_fhp = &high_fh;
sta... |
google | android | pwrite03 | .c | platform/external/ltp/testcases/kernel/syscalls/pwrite/pwrite03.c | 711 | utf_8 | 53cdb13ae27943555629faa2bc92f2c2 | */
/*\
* [Description]
*
* Tests for a special case NULL buffer with size 0 is expected to return 0.
*/
#include <errno.h>
#include "tst_test.h"
static int fd;
static void verify_pwrite(void)
{
TST_EXP_PASS(pwrite(fd, NULL, 0, 0), "pwrite(%d, NULL, 0) == 0", fd);
}
static void setup(void)
{
fd = SAFE_OPEN("test_... |
google | android | pwrite01 | .c | platform/external/ltp/testcases/kernel/syscalls/pwrite/pwrite01.c | 2,566 | utf_8 | ce341bcf4e5c7f42a253d911994a6867 | * 07/2001 Ported by Wayne Boyer
*/
/*\
* [Description]
*
* Verify the functionality of pwrite() by writing known data using pwrite()
* to the file at various specified offsets and later read from the file from
* various specified offsets, comparing the data written aganist the data
* read using read().
*/
#inc... |
google | android | pwrite04 | .c | platform/external/ltp/testcases/kernel/syscalls/pwrite/pwrite04.c | 2,345 | utf_8 | ee0da2020992aeb437c6fc857d2e2e38 | * ported from SPIE, section2/filesuite/pread_pwrite.c, by Airong Zhang
*/
/*\
* [Description]
*
* Test the pwrite() system call with O_APPEND.
*
* Writing 2k data to the file, close it and reopen it with O_APPEND.
*
* POSIX requires that opening a file with the O_APPEND flag should have no effect on the
* loc... |
google | android | pwrite02 | .c | platform/external/ltp/testcases/kernel/syscalls/pwrite/pwrite02.c | 2,224 | utf_8 | 4f5e39ecf4fadb70297632f49aa87e4c | */
/*\
* [Description]
*
* Test basic error handling of the pwrite syscall.
*
* - ESPIPE when attempted to write to an unnamed pipe
* - EINVAL the specified offset position was invalid
* - EBADF fd is not a valid file descriptor
* - EBADF fd is not open for writing
* - EFAULT when attempted to write with buf ... |
google | android | utimes01 | .c | platform/external/ltp/testcases/kernel/syscalls/utimes/utimes01.c | 2,840 | utf_8 | b9b3de5ef039bf791b105935b3411a28 | */
/*
* Description:
* Verify that,
* 1) utimes() returns -1 and sets errno to EACCES if times
* is NULL, the caller's effective user ID does not match
* the owner of the file, the caller does not have write
* access to the file, and the caller is not privileged.
* 2) utimes() returns -1 an... |
google | android | uname01 | .c | platform/external/ltp/testcases/kernel/syscalls/uname/uname01.c | 632 | utf_8 | 6eb0d941571211869951b3055fc4638c | *
* Basic test for uname(2):
* Calling uname() succeeded and got correct sysname.
*
*/
#include <sys/utsname.h>
#include <errno.h>
#include <string.h>
#include "tst_test.h"
static void verify_uname(void)
{
struct utsname un;
memset(&un, 0, sizeof(un));
TST_EXP_PASS(uname(&un));
if (!TST_PASS)
return;
if (st... |
google | android | uname02 | .c | platform/external/ltp/testcases/kernel/syscalls/uname/uname02.c | 510 | utf_8 | ed3a2bb7528ba0369c622a709b8b2bbc | *
* Basic test for uname():
* Calling uname() with invalid buf got EFAULT.
*
*/
#include <errno.h>
#include <sys/utsname.h>
#include "tst_test.h"
static void *bad_addr;
static void verify_uname(void)
{
TST_EXP_FAIL(uname(bad_addr), EFAULT);
}
static void setup(void)
{
bad_addr = tst_get_bad_addr(NULL);
}
static ... |
google | android | uname04 | .c | platform/external/ltp/testcases/kernel/syscalls/uname/uname04.c | 1,896 | utf_8 | 38d3fe31036e3205cd2c71b93420106c | */
/*
* Check that memory after the string terminator in all the utsname fields has
* been zeroed. cve-2012-0957 leaked kernel memory through the release field
* when the UNAME26 personality was set.
*
* Thanks to Kees Cook for the original proof of concept:
* http://www.securityfocus.com/bid/55855/info
*/
#inc... |
google | android | mq_open01 | .c | platform/external/ltp/testcases/kernel/syscalls/mq_open/mq_open01.c | 5,864 | utf_8 | 1ddc48ba3edc8d97553f932f7ce542a1 | */
#include <errno.h>
#include <mqueue.h>
#include <pwd.h>
#include "tst_test.h"
#include "tst_safe_file_ops.h"
#include "tst_safe_posix_ipc.h"
#define QUEUE_NAME "/test_mqueue"
#define QUEUE_INIT "/init_mqueue"
static uid_t euid;
static struct passwd *pw;
static char *qname;
static struct rlimit rlim;
static mqd_t fd... |
google | android | fsopen02 | .c | platform/external/ltp/testcases/kernel/syscalls/fsopen/fsopen02.c | 1,154 | utf_8 | d1c272b28d7e2e69b651b838af680c34 | *
* Basic fsopen() failure tests.
*/
#include "tst_test.h"
#include "lapi/fsmount.h"
const char *invalid_fs = "invalid";
const char *valid_fs;
static struct tcase {
char *name;
const char **fs;
unsigned int flags;
int exp_errno;
} tcases[] = {
{"invalid-fs", &invalid_fs, 0, ENODEV},
{"invalid-flags", &valid_fs... |
google | android | fsopen01 | .c | platform/external/ltp/testcases/kernel/syscalls/fsopen/fsopen01.c | 1,742 | utf_8 | f3c63de7a37b42c1d7784de27e88f246 | *
* Basic fsopen() test which tries to configure and mount the filesystem as
* well.
*/
#include "tst_test.h"
#include "lapi/fsmount.h"
#define MNTPOINT "mntpoint"
#define TCASE_ENTRY(_flags) {.name = "Flag " #_flags, .flags = _flags}
static struct tcase {
char *name;
unsigned int flags;
} tcases[] = {
TCASE_ENT... |
google | android | reboot01 | .c | platform/external/ltp/testcases/kernel/syscalls/reboot/reboot01.c | 890 | utf_8 | 2c20cf5151f77a41ab11809120601749 | */
/*\
* [Description]
*
* Basic test of libc wrapper of reboot(2) system call.
*
* Test LINUX_REBOOT_CMD_CAD_ON, LINUX_REBOOT_CMD_CAD_OFF commands,
* which do not perform reboot.
*/
#include <unistd.h>
#include <sys/reboot.h>
#include <linux/reboot.h>
#include "tst_test.h"
#define CMD_DESC(x) .cmd = x, .desc =... |
google | android | reboot02 | .c | platform/external/ltp/testcases/kernel/syscalls/reboot/reboot02.c | 1,191 | utf_8 | 4ea13dc52040bcc866eeafb3add1b351 | */
/*\
* [Description]
* Test whether libc wrapper of reboot(2) system call returns appropriate
* error number for invalid cmd parameter or invalid user.
*/
#include <unistd.h>
#include <sys/reboot.h>
#include <linux/reboot.h>
#include <pwd.h>
#include "tst_test.h"
#define INVALID_CMD 100
#define CMD_DESC(x) .cmd ... |
google | android | fsync04 | .c | platform/external/ltp/testcases/kernel/syscalls/fsync/fsync04.c | 1,343 | utf_8 | 5e89c17c0fa9b25538ca1a6461208294 | */
/*
* fsync04
*
* It basically tests fsync() to sync test file having large dirty file pages
* to block device. Also, it tests all supported filesystems on a test block
* device.
*/
#define _GNU_SOURCE
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include "tst_test.h"
#defin... |
google | android | fsync03 | .c | platform/external/ltp/testcases/kernel/syscalls/fsync/fsync03.c | 2,232 | utf_8 | 6fcfb3735d84e0016a599c9b6d513130 | */
/*
* Test Description:
* Testcase to check that fsync(2) sets errno correctly.
* 1. Call fsync() on a pipe(fd), and expect EINVAL.
* 2. Call fsync() on a socket(fd), and expect EINVAL.
* 3. Call fsync() on a closed fd, and test for EBADF.
* 4. Call fsync() on an invalid fd, and test for EBADF.
* 5. Cal... |
google | android | fsync01 | .c | platform/external/ltp/testcases/kernel/syscalls/fsync/fsync01.c | 978 | utf_8 | 7541b7274413f9d1629e091eb323e1c0 | * AUTHOR : William Roske
* CO-PILOT : Dave Fenner
*/
#include <unistd.h>
#include <errno.h>
#include <stdio.h>
#include "tst_test.h"
static char fname[255];
static int fd;
#define BUF "davef"
static void verify_fsync(void)
{
unsigned int i;
for (i = 0; i < 10; i++) {
SAFE_WRITE(SAFE_WRITE_ALL, fd, BUF, s... |
google | android | fsync02 | .c | platform/external/ltp/testcases/kernel/syscalls/fsync/fsync02.c | 2,696 | utf_8 | 4d9dac56bdb1e9d91569a03b78877318 | */
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/statvfs.h>
#include <fcntl.h>
#include <sys/resource.h>
#include <time.h>
#include "tst_test.h"
#define BLOCKSIZE 8192
#define MAXBLKS 65536
#define BUF_SIZE 2048
char tempfile[40] = "";
char pbuf[BUF_SIZE];
int fd;
off_t max_blks = MAXBLKS... |
google | android | setuid03 | .c | platform/external/ltp/testcases/kernel/syscalls/setuid/setuid03.c | 804 | utf_8 | 299843e442f6960c34509a37396f5502 | */
/*\
* [Description]
*
* This test will switch to nobody user for correct error code collection.
* Verify setuid returns errno EPERM when it switches to root_user.
*/
#include <errno.h>
#include <pwd.h>
#include <unistd.h>
#include <sys/types.h>
#include "tst_test.h"
#include "compat_tst_16.h"
#define ROOT_USER... |
google | android | setuid04 | .c | platform/external/ltp/testcases/kernel/syscalls/setuid/setuid04.c | 1,524 | utf_8 | 2e94b7b9a4c895689c724d9a89346f89 | */
/*
* DESCRIPTION
* Check if setuid behaves correctly with file permissions. The test
* creates a file as ROOT with permissions 0644, does a setuid and then
* tries to open the file with RDWR permissions. The same test is done
* in a fork to check if new UIDs are correctly passed to the son.
*/
#include <errno... |
google | android | setuid01 | .c | platform/external/ltp/testcases/kernel/syscalls/setuid/setuid01.c | 616 | utf_8 | e0db2df1693838900c75ad035124cc1f | */
/*\
* [Description]
*
* Verify that setuid(2) returns 0 and effective uid has
* been set successfully as a normal or super user.
*/
#include <errno.h>
#include <unistd.h>
#include <sys/types.h>
#include "tst_test.h"
#include "compat_tst_16.h"
static void verify_setuid(void)
{
uid_t uid;
uid = getuid();
UID1... |
google | android | semop02 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/semop/semop02.c | 5,252 | utf_8 | 7bb36fe92646fc719bf16b35706dbc22 | /*
* E2BIG - nsops is greater than max number of operations allowed per syscall
* EACCESS - calling process does not have permission to alter semaphore
* EFAULT - invalid address passed for sops
* EINVAL - nonpositive nsops
* EINVAL - negative semid
* ERANGE - semop + semval > semvmx a maximal semaphore val... |
google | android | semop03 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/semop/semop03.c | 2,865 | iso_8859_1 | a93b17c438d02afc8821e015f9488a38 | */
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/wait.h>
#include "tst_test.h"
#include "libnewipc.h"
#include "lapi/sem.h"
#include "semop.h"
static key_t semkey;
static int sem_id = -1;
static struct tst_ts timeout;
struct test_case_t {
union semun semunptr;
short op;
short flg;
sho... |
google | android | semop01 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/semop/semop01.c | 2,315 | utf_8 | 354b1a13efeacfb2818997b672acd5f4 | */
#include <stdlib.h>
#include "tst_test.h"
#include "libnewipc.h"
#include "lapi/sem.h"
#include "semop.h"
#define NSEMS 4
static int sem_id = -1;
static key_t semkey;
static unsigned short int sarr[PSEMS];
static union semun get_arr = {.array = sarr};
static struct sembuf sops[PSEMS];
static struct tst_ts timeout;
... |
google | android | shmdt01 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/shmdt/shmdt01.c | 1,521 | utf_8 | f23b0e6ca1132d316fe96cc08c606b93 | */
/*\
* [Description]
*
* This case check whether we get SIGSEGV when write a value to a detached
* shared memory resource.
*/
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <setjmp.h>
#include "tst_test.h"
#include "libnewipc.h"
#include "tst_safe_sysv_ipc.h"
static int shm_id = -1, s... |
google | android | shmdt02 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/shmdt/shmdt02.c | 977 | utf_8 | 3c14a5a2b097b650722cff4cac2e5999 | */
/*\
* [Description]
*
* Tests basic error handing of the shmdt syscall.
*
* -EINVAL there is no shared memory segment attached at shmaddr.
* -EINVAL shmaddr is not aligned on a page boundary.
*/
#include <sys/types.h>
#include <sys/shm.h>
#include "tst_test.h"
#include "libnewipc.h"
static void *non_attched_... |
google | android | shmctl03 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/shmctl/shmctl03.c | 931 | utf_8 | e3db1af72351de1464f0cf36e65418f8 | */
/*\
* [Description]
*
* Call shmctl() with IPC_INFO flag and check that the data are consistent with
* /proc/sys/kernel/shm*.
*/
#define _GNU_SOURCE
#include "tst_test.h"
#include "tst_safe_sysv_ipc.h"
#include "libnewipc.h"
static void verify_ipcinfo(void)
{
struct shminfo info;
TEST(shmctl(0, IPC_INFO, (st... |
google | android | shmctl07 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/shmctl/shmctl07.c | 1,465 | utf_8 | 1e2cc625469e48985a3ebd7700a2869e | */
/*\
* [Description]
*
* Test for a SHM_LOCK and SHM_UNLOCK.
*/
#define _GNU_SOURCE
#include <stdio.h>
#include "tst_test.h"
#include "tst_safe_sysv_ipc.h"
#include "libnewipc.h"
#define SHM_SIZE 2048
static int shm_id = -1;
static void verify_shmlock(void)
{
struct shmid_ds ds;
TEST(shmctl(shm_id, SHM_LOCK, N... |
google | android | shmctl05 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/shmctl/shmctl05.c | 2,881 | utf_8 | eed7f8e7e026ac6788196a2b99285ca4 | */
/*\
* [Description]
*
* Regression test for commit
* 3f05317d9889 (ipc/shm: fix use-after-free of shm file via remap_file_pages()).
*
* This bug allowed the remap_file_pages() syscall to use the file of a System
* V shared memory segment after its ID had been reallocated and the file
* freed. This test repr... |
google | android | shmctl08 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/shmctl/shmctl08.c | 2,127 | utf_8 | e5f902f53e6ff729fe36df061de7d0c1 | */
/*\
* [Description]
*
* Test for a SHM_SET.
*
* The test clears the group and others bits from the shm_perm.mode and checks
* the result as well as if the ctime was updated correctly.
*/
#define _GNU_SOURCE
#include <stdio.h>
#include "tst_test.h"
#include "tst_safe_sysv_ipc.h"
#include "libnewipc.h"
#define... |
google | android | shmctl02 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/shmctl/shmctl02.c | 3,596 | utf_8 | adc11b53dae713717dee1e6a1ad2196d | */
/*\
* [Description]
*
* Test for EACCES, EFAULT and EINVAL errors.
*
* * EACCES - segment has no read or write permissions
* * EFAULT - IPC_SET & buf isn't valid
* * EFAULT - IPC_STAT & buf isn't valid
* * EINVAL - the command is not valid
* * EINVAL - the shmid is not valid
* * EINVAL - the shmid belongs... |
google | android | shmctl01 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/shmctl/shmctl01.c | 5,159 | utf_8 | 5a4dcee6d14f0af508ed6aebfa2f88f3 | */
/*\
* [Description]
*
* Verify that shmctl() IPC_STAT and SHM_STAT reports correct data.
*
* The shm_nattach is excercised by:
*
* - forking() children that attach and detach SHM
* - attaching the SHM before fork and letting the children detach it
*
* We check that the number shm_nattach is correct after ... |
google | android | shmctl04 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/shmctl/shmctl04.c | 4,251 | utf_8 | c09b8188e6cc863367df7be509d33068 | */
/*\
* [Description]
*
* Call shmctl() with SHM_INFO flag and check that:
*
* * The returned index points to a valid SHM by calling SHM_STAT_ANY
* * Also count that valid indexes < returned max index sums up to used_ids
* * And the data are consistent with /proc/sysvipc/shm
*
* There is a possible race betw... |
google | android | shmctl06 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/shmctl/shmctl06.c | 1,278 | utf_8 | 8a714794d0dad13153f57072780faefc | */
/*\
* [Description]
*
* Cross verify the _high fields being set to 0 by the kernel.
*/
#include <sys/shm.h>
#include "lapi/shmbuf.h"
#include "libnewipc.h"
#include "tst_test.h"
#include "tst_safe_sysv_ipc.h"
#ifdef HAVE_SHMID64_DS_TIME_HIGH
static void run(void)
{
struct shmid64_ds buf_ds = {
.shm_atime_hig... |
google | android | shmget04 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/shmget/shmget04.c | 1,491 | utf_8 | 1290cc374311450b48f265582fce461b | * 03/2001 - Written by Wayne Boyer
*/
/*\
* [Description]
*
* Test for EACCES error.
*
* Create a shared memory segment without read or write permissions under
* unpriviledged user and call shmget() with SHM_RD/SHM_WR/SHM_RW flag to
* trigger EACCES error.
*/
#include <errno.h>
#include <sys/types.h>
#includ... |
google | android | shmget05 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/shmget/shmget05.c | 1,566 | utf_8 | f99f7bf9167ae4fab092463a40160f44 | */
/*\
* [Description]
*
* It is a basic test for shm_next_id.
*
* shm_next_id specifies desired id for next allocated IPC shared memory. By
* default it's equal to -1, which means generic allocation logic.
* Possible values to set are in range {0..INT_MAX}.
* The value will be set back to -1 by kernel after s... |
google | android | shmget06 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/shmget/shmget06.c | 1,747 | utf_8 | 2df2b37a5851155f54425ca570fe812b | */
/*\
* [Description]
*
* It is a basic test for shm_next_id.
*
* When the shared memory segment identifier that shm_next_id stored is already
* in use, call shmget with different key just use another unused value in range
* [0,INT_MAX]. Kernel doesn't guarantee the desired id.
*/
#include <errno.h>
#include ... |
google | android | shmget03 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/shmget/shmget03.c | 1,702 | utf_8 | e67c5f2348ab585e73ecfcfef652aac5 | * 03/2001 - Written by Wayne Boyer
*/
/*\
* [Description]
*
* Test for ENOSPC error.
*
* ENOSPC - All possible shared memory segments have been taken (SHMMNI).
*/
#include <errno.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <stdlib.h>
#include <pwd.h>
#include <sys/shm.h>
#include "tst_test.h"
#inc... |
google | android | shmget02 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/shmget/shmget02.c | 3,921 | utf_8 | 551251aad32c57034a2e1b7cbbc7e4a5 | */
/*\
* [Description]
*
* Test for ENOENT, EEXIST, EINVAL, EACCES, EPERM errors.
*
* ENOENT - No segment exists for the given key and IPC_CREAT was not specified.
* EEXIST - the segment exists and IPC_CREAT | IPC_EXCL is given.
* EINVAL - A new segment was to be created and size is less than SHMMIN or
* great... |
google | android | msgctl04 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl04.c | 3,177 | iso_8859_1 | 59935427a73857f7bab1bc0398d884a2 | */
/*
* Test for EACCES, EFAULT and EINVAL errors using a variety of incorrect
* calls.
*/
#include <errno.h>
#include <pwd.h>
#include "tst_test.h"
#include "tst_safe_sysv_ipc.h"
#include "libnewipc.h"
#include "lapi/syscalls.h"
static int msg_id1 = -1;
static int msg_id2 = -1;
static int msg_id3 = -1;
static int ... |
google | android | msgctl12 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl12.c | 1,345 | utf_8 | 4d09286ace0f9b1e0072122bb5b79585 | */
/*
* msgctl12 - test for IPC_INFO MSG_INFO and MSG_STAT.
*/
#define _GNU_SOURCE
#include <errno.h>
#include "tst_test.h"
#include "tst_safe_sysv_ipc.h"
#include "libnewipc.h"
static int msg_q = -1;
static int index_q;
static struct msginfo msginfo_buf;
static struct msqid_ds msgqid_buf;
static struct tcase {
int... |
google | android | msgctl05 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl05.c | 1,152 | utf_8 | 58290bd5953b782974ede6a87114717a | *
* Description:
* Cross verify the _high fields being set to 0 by the kernel.
*/
#include <sys/msg.h>
#include "lapi/msgbuf.h"
#include "libnewipc.h"
#include "tst_test.h"
#include "tst_safe_sysv_ipc.h"
#ifdef HAVE_MSQID64_DS_TIME_HIGH
static void run(void)
{
struct msqid64_ds buf_ds = {
.msg_stime_high = 0x0A0... |
google | android | msgctl02 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl02.c | 1,484 | utf_8 | 867b27e6caf8a5d12d57605e8e70b83f | */
/*
* Create a message queue, then issue the IPC_SET command to lower the
* msg_qbytes value.
*/
#include <errno.h>
#include "tst_test.h"
#include "tst_safe_sysv_ipc.h"
#include "libnewipc.h"
static int msg_id = -1;
struct msqid_ds orig_buf;
static void verify_msgctl(void)
{
struct msqid_ds buf = orig_buf;
buf.... |
google | android | msgctl01 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl01.c | 3,542 | utf_8 | 0d2ab3d923731e265f76bc91738ff78e | */
/*
* Test that IPC_STAT command succeeds and the the buffer is filled with
* correct data.
*/
#include <errno.h>
#include "tst_test.h"
#include "tst_safe_sysv_ipc.h"
#include "libnewipc.h"
static int msg_id = -1;
static time_t creat_time;
static key_t msgkey;
static uid_t uid;
static gid_t gid;
unsigned short mo... |
google | android | msgctl06 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl06.c | 3,962 | utf_8 | 83b391ccc51b551e604b2e470bf8dd18 | */
/*\
* [Description]
*
* Call msgctl() with MSG_INFO flag and check that:
*
* * The returned index points to a valid MSG by calling MSG_STAT_ANY
* * Also count that valid indexes < returned max index sums up to used_ids
* * And the data are consistent with /proc/sysvipc/msg
*
* There is a possible race betw... |
google | android | msgctl03 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl03.c | 905 | utf_8 | 786857ee4837c72d7752439afe7d68a1 | */
/*
* DESCRIPTION
* msgctl13 - test for IPC_RMID
*/
#include <errno.h>
#include "tst_test.h"
#include "tst_safe_sysv_ipc.h"
#include "libnewipc.h"
static void verify_msgctl(void)
{
struct msqid_ds buf;
int msg_q;
msg_q = SAFE_MSGGET(IPC_PRIVATE, MSG_RW);
TEST(msgctl(msg_q, IPC_RMID, NULL));
if (TST_RET != 0)... |
google | android | msgrcv07 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/msgrcv/msgrcv07.c | 6,648 | utf_8 | ada344451798e0d1ffb5131423b821ad | *
* Basic test for msgrcv(2) using MSG_EXCEPT, MSG_NOERROR, MSG_COPY and
* different msg_typ(zero,positive,negative).
*
* * With MSG_EXCEPT flag any message type but the one passed to the function
* is received.
*
* * With MSG_NOERROR and buffer size less than message size only part of the
* buffer is rece... |
google | android | msgrcv01 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/msgrcv/msgrcv01.c | 2,155 | utf_8 | bd246e3942337497a30a6210b83314a6 | *
* msgrcv01 - test that msgrcv() receives the expected message
*/
#include <string.h>
#include <sys/wait.h>
#include "tst_test.h"
#include "tst_safe_sysv_ipc.h"
#include "tst_clocks.h"
#include "libnewipc.h"
static key_t msgkey;
static int queue_id = -1, pid;
static struct buf {
long type;
char mtext[MSGSIZE];
} ... |
google | android | msgrcv03 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/msgrcv/msgrcv03.c | 2,506 | utf_8 | 42d24ab9d210b6cd1fc3f4fa6a5ebb33 | *
* This is a basic test about MSG_COPY flag.
* This flag was added in 3.8 for the implementation of the kernel checkpoint
* restore facility and is available only if the kernel was built with the
* CONFIG_CHECKPOINT_RESTORE option.
* On old kernel without this support, it only ignores this flag and doesn't
* re... |
google | android | msgrcv02 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/msgrcv/msgrcv02.c | 2,815 | utf_8 | eb6bf0e69e4c21aa66c27ace76eccb56 | *
* Basic error test for msgrcv(2).
*
* 1)msgrcv(2) fails and sets errno to E2BIG if the message text length is
* greater than msgsz and MSG_NOERROR isn't specified in msgflg.
*
* 2)The calling process does not have read permission on the message
* queue, so msgrcv(2) fails and sets errno to EACCES.
*
*... |
google | android | msgrcv05 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/msgrcv/msgrcv05.c | 1,250 | utf_8 | 41c3838a390918a307d2eb5c446c40a5 | *
* msgrcv error test for EINTR.
*/
#include <sys/types.h>
#include <sys/wait.h>
#include <signal.h>
#include <stdlib.h>
#include "tst_test.h"
#include "tst_safe_sysv_ipc.h"
#include "libnewipc.h"
static key_t msgkey;
static int queue_id = -1;
static struct buf {
long type;
char mtext[MSGSIZE];
} rcv_buf;
static v... |
google | android | msgrcv08 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/msgrcv/msgrcv08.c | 2,058 | utf_8 | 7705d971c38e98256f9659d273d763ce | * Date: Mon Jan 27 17:07:11 2014 -0800
*
* ipc: fix compat msgrcv with negative msgtyp
*
* Reproduce:
*
* 32-bit application using the msgrcv() system call
* gives the error message:
*
* msgrcv: No message of desired type
*
* If this progarm is compiled as 64-bit ap... |
google | android | msgrcv06 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/msgrcv/msgrcv06.c | 1,195 | utf_8 | 1b3b43a9c7c01a36ddbca0a5efd944e9 | *
* msgrcv error test for EIDRM.
*/
#include <errno.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include <stdlib.h>
#include "tst_test.h"
#include "tst_safe_sysv_ipc.h"
#include "libnewipc.h"
static key_t msgkey;
static int queue_id = -1;
static struct buf {
long type;
c... |
google | android | msgstress02 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/msgstress/msgstress02.c | 8,932 | utf_8 | c411e5173e4f9fb689bdd33da34b7b88 | /*
*/
/*
* Get and manipulate a message queue.
*/
#define _XOPEN_SOURCE 500
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include <sys/wait.h>
#include <signal.h>
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include "test... |
google | android | msgstress01 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/msgstress/msgstress01.c | 6,489 | utf_8 | ac5b98c42ae966b446bc8495d11f9e70 | /*
*/
/*
* Get and manipulate a message queue.
*/
#define _XOPEN_SOURCE 500
#include <signal.h>
#include <errno.h>
#include <string.h>
#include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <values.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/stat.h>
#include <sys/ipc... |
google | android | msgstress04 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/msgstress/msgstress04.c | 10,140 | utf_8 | e6e6fe59a462bff1f1ae71b6428990db | /*
*/
/*
* Get and manipulate a message queue.
* Same as msgstress02 but gets the actual msgmni value under procfs.
*/
#define _XOPEN_SOURCE 500
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include <sys/wait.h>
#include <signal.h>
#include <errno.h>
#include <stdio.h>
#inc... |
google | android | msgstress03 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/msgstress/msgstress03.c | 6,523 | utf_8 | 933145e163a0abb3c8eb0d81a7451221 | /*
*/
/*
* Get and manipulate a message queue.
* Same as msgstress01 but gets the actual msgmni value under procfs.
*/
#define _XOPEN_SOURCE 500
#include <signal.h>
#include <errno.h>
#include <string.h>
#include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <values.h>
#include <sys/... |
google | android | msgget02 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/msgget/msgget02.c | 2,079 | utf_8 | 7fc7c6661ef8ac0be2ff75cc50721e2a | */
/*\
* [Description]
*
* Test for EEXIST, ENOENT, EACCES errors.
*
* 1) msgget(2) fails if a message queue exists for key and msgflg
* specified both IPC_CREAT and IPC_EXCL.
* 2) msgget(2) fails if no message queue exists for key and msgflg
* did not specify IPC_CREAT.
* 3) msgget(2) fails if a messag... |
google | android | msgget05 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/msgget/msgget05.c | 1,719 | utf_8 | bb979002937da7d57eac5e9797a25636 | */
/*\
* [Description]
*
* It is a basic test for msg_next_id.
* When the message queue identifier that msg_next_id stored is already in use,
* call msgget with different key just use another unused value in range
* [0,INT_MAX]. Kernel doesn't guarantee the desired id.
*/
#include <errno.h>
#include <string.h>
... |
google | android | msgget04 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/msgget/msgget04.c | 1,543 | utf_8 | db37695738344c2c065434321277444b | */
/*\
* [Description]
*
* It is a basic test for msg_next_id.
* msg_next_id specifies desired id for next allocated IPC message. By
* default it's equal to -1, which means generic allocation logic.
* Possible values to set are in range {0..INT_MAX}.
* The value will be set back to -1 by kernel after successful... |
google | android | msgget01 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/msgget/msgget01.c | 1,266 | utf_8 | 534d4f01823a72bb1a193d7dd6d1c60f | */
/*\
* [Description]
*
* Create a message queue, write a message to it and
* read it back.
*/
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include "tst_test.h"
#include "tst_safe_sysv_ipc.h"
#include "libnewipc.h"
static int queue_id = -1;
static key_t... |
google | android | msgget03 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/msgget/msgget03.c | 1,695 | utf_8 | 939c6dd59ac386e2d0630c2230161b1b | */
/*\
* [Description]
*
* Test for ENOSPC error.
*
* ENOSPC - All possible message queues have been taken (MSGMNI)
*/
#include <errno.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include <stdlib.h>
#include "tst_test.h"
#include "tst_safe_sysv_ipc.h"
#include "libnewipc.h"
static int ma... |
google | android | shmat01 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/shmat/shmat01.c | 3,331 | utf_8 | 538bde66c8b9d443fecd461489bacfac | */
/*
* DESCRIPTION
*
* 1) shmat() chooses a suitable (unused) address when shmaddr is NULL.
* 2) shmat() attaches shm segment to the shmaddr when shmaddr is a
* page-aligned address.
* 3) shmat() attaches shm segment to the address equal to shmaddr rounded
* down to the nearest multiple of SHMLBA when sh... |
google | android | shmat02 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/shmat/shmat02.c | 2,177 | utf_8 | 8b015c1635dac6bb6b7d6a694f0a08c2 | */
/*
* DESCRIPTION
*
* 1) shmat() fails and set errno to EINVAL when shmid is invalid.
* 2) shmat() fails and set errno to EINVAL when shmaddr is not page
* aligned and SHM_RND is not given
* 3) shmat() fails and set errno to EACCES when the shm resource has
* no read/write permission.
*/
#include <errn... |
google | android | shmat03 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/shmat/shmat03.c | 2,866 | utf_8 | ce7e2cb7ee335ede04cf78816f10ecec | * Date: Fri May 25 14:47:30 2018 -0700
*
* ipc/shm: fix shmat() nil address after round-down when remapping
*
* Which makes sure that SHM_REMAP forbids NULL address consistently for
* SHM_RND as well.
*
* The timeline went as:
*
* 95e91b831f87 (ipc/shm: Fix shmat mmap nil-page protection)
* a73ab244f0da (... |
google | android | msgsnd06 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/msgsnd/msgsnd06.c | 1,370 | utf_8 | 6056a72cdefcfa33f8b1485fc91df182 | */
/*
* DESCRIPTION
* Tests if EIDRM is returned when message queue was removed while
* msgsnd() was trying to send a message.
*/
#include <errno.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include "tst_test.h"
#include "tst_safe_sysv_ipc.h"
#include "libnewipc.h"
stati... |
google | android | msgsnd02 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/msgsnd/msgsnd02.c | 2,435 | utf_8 | 8dd34cd5f7113e0a404ff559a42508ec | */
/*
* DESCRIPTION
* 1) The calling process does not have write permission on the message
* queue, so msgsnd(2) fails and sets errno to EACCES.
* 2) msgsnd(2) fails and sets errno to EFAULT if the message buffer address
* is invalid.
* 3) msgsnd(2) fails and sets errno to EINVAL if the queue ID is invalid... |
google | android | msgsnd01 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/msgsnd/msgsnd01.c | 1,970 | utf_8 | da2d09310d390b3a6505c9e872d88bc4 | */
/*
* DESCRIPTION
* test that msgsnd() enqueues a message correctly.
*/
#include <errno.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include "tst_test.h"
#include "tst_safe_sysv_ipc.h"
#include "tst_clocks.h"
#include "libnewipc.h"
static key_t msgkey;
static int queue_id = -1, pid;
static... |
google | android | msgsnd05 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/msgsnd/msgsnd05.c | 1,998 | utf_8 | d3adc40a252f0194bb781ed185a08442 | */
/*
* DESCRIPTION
* 1) msgsnd(2) fails and sets errno to EAGAIN if the message can't be
* sent due to the msg_qbytes limit for the queue and IPC_NOWAIT is
* specified.
* 2) msgsnd(2) fails and sets errno to EINTR if msgsnd(2) sleeps on a
* full message queue condition and the process catches a signal.... |
google | android | semget03 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/semget/semget03.c | 3,127 | utf_8 | f3225acf043710b4a8c98bcdf7736e6f | /*
*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* NAME
* semget03.c
*
* DESCRIPTION
* semget03 - test for ENOENT error
*
* ALGORITHM
* loop if that option was specified
* call semget() with a valid key but with no associated semaphore set
* and IPC_CREAT is no... |
google | android | semget01 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/semget/semget01.c | 4,009 | utf_8 | 263d9f0dd4b492ed72f1f99ee96769e6 | /*
*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* NAME
* semget01.c
*
* DESCRIPTION
* semget01 - test that semget() correclty creates a semaphore set
*
* ALGORITHM
* loop if that option was specified
* call semget() to create the semaphore set
* check the return ... |
google | android | semget06 | .c | platform/external/ltp/testcases/kernel/syscalls/ipc/semget/semget06.c | 3,290 | utf_8 | 7424dd9f4b40e1fb997e0f0ee3c62373 | /*
*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* NAME
* semget06.c
*
* DESCRIPTION
* semget06 - test for EINVAL error
*
* ALGORITHM
* loop if that option was specified
* call semget() using two different invalid cases - too many and too
* few primitive semaph... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.