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 | quotactl02 | .c | platform/external/ltp/testcases/kernel/syscalls/quotactl/quotactl02.c | 4,959 | utf_8 | d8127b31a7083ee0a67d961c78d6353d | */
/*\
* [Description]
*
* This testcases checks that quotactl(2) on xfs filesystem succeeds to:
*
* - turn off xfs quota and get xfs quota off status for user
* - turn on xfs quota and get xfs quota on status for user
* - set and use Q_XGETQUOTA to get xfs disk quota limits for user
* - set and use Q_XGETNEXT... |
google | android | quotactl07 | .c | platform/external/ltp/testcases/kernel/syscalls/quotactl/quotactl07.c | 2,592 | utf_8 | af7b4e22d8243362d3314f879e7ec81e | */
/*\
* [Description]
*
* This is not only a functional test but also a error test for Q_XQUOTARM.
*
* It is a regresstion test for kernel commit 3dd4d40b4208
* ("xfs: Sanity check flags of Q_XQUOTARM call").
*/
#include <errno.h>
#include <unistd.h>
#include <stdio.h>
#include <sys/quota.h>
#include <sys/stat... |
google | android | quotactl08 | .c | platform/external/ltp/testcases/kernel/syscalls/quotactl/quotactl08.c | 6,739 | utf_8 | e197067661133e43d380d5a7bc724645 | */
/*\
* [Description]
* This testcases checks that quotactl(2) on ext4 filesystem succeeds to:
*
* - turn on quota with Q_QUOTAON flag for user
* - set disk quota limits with Q_SETQUOTA flag for user
* - get disk quota limits with Q_GETQUOTA flag for user
* - set information about quotafile with Q_SETINFO flag... |
google | android | quotactl01 | .c | platform/external/ltp/testcases/kernel/syscalls/quotactl/quotactl01.c | 6,810 | utf_8 | 4b646bfe0e189a493673f7d453ed609a | */
/*\
* [Description]
* This testcases checks that quotactl(2) on ext4 filesystem succeeds to:
*
* - turn on quota with Q_QUOTAON flag for user
* - set disk quota limits with Q_SETQUOTA flag for user
* - get disk quota limits with Q_GETQUOTA flag for user
* - set information about quotafile with Q_SETINFO flag... |
google | android | quotactl04 | .c | platform/external/ltp/testcases/kernel/syscalls/quotactl/quotactl04.c | 4,662 | utf_8 | 6083e8ba1ed395be2f10f84e1a811fb9 | */
/*\
* [Description]
*
* This testcase checks that quotactl(2) on ext4 filesystem succeeds to:
*
* - turn on quota with Q_QUOTAON flag for project
* - set disk quota limits with Q_SETQUOTA flag for project
* - get disk quota limits with Q_GETQUOTA flag for project
* - set information about quotafile with Q_S... |
google | android | quotactl03 | .c | platform/external/ltp/testcases/kernel/syscalls/quotactl/quotactl03.c | 2,294 | utf_8 | 93a4db7cd0e7646637efa100bc15f5ef | */
/*\
* [Description]
*
* quotactl(2) with XGETNEXTQUOTA looks for the next active quota for an user
* equal or higher to a given ID, in this test the ID is specified to a value
* close to UINT_MAX(max value of unsigned int). When reaching the upper limit
* and finding no active quota, it should return -1 and s... |
google | android | quotactl05 | .c | platform/external/ltp/testcases/kernel/syscalls/quotactl/quotactl05.c | 3,341 | utf_8 | aa8589f491817313cf9afaf4cf4923f3 | */
/*\
* [Description]
*
* This testcases checks that quotactl(2) on xfs filesystem succeeds to:
*
* - turn off xfs quota and get xfs quota off status for project
* - turn on xfs quota and get xfs quota on status for project
* - set and use Q_XGETQUOTA to get xfs disk quota limits for project
* - set and use Q... |
google | android | quotactl09 | .c | platform/external/ltp/testcases/kernel/syscalls/quotactl/quotactl09.c | 4,769 | utf_8 | ca765d932a398e5532c55d4038a99bff | */
/*\
* [Description]
*
* Tests basic error handling of the quotactl syscall without visible quota files
* (use quotactl and quotactl_fd syscall):
*
* - EFAULT when addr or special is invalid
* - EINVAL when cmd or type is invalid
* - ENOTBLK when special is not a block device
* - ERANGE when cmd is Q_SETQUO... |
google | android | execlp01_child | .c | platform/external/ltp/testcases/kernel/syscalls/execlp/execlp01_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 | execlp01 | .c | platform/external/ltp/testcases/kernel/syscalls/execlp/execlp01.c | 756 | utf_8 | aa303caec7c31562bc0575882e972a23 | * AUTHOR : William Roske
* CO-PILOT : Dave Fenner
*/
#include <errno.h>
#include <string.h>
#include <signal.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/wait.h>
#include "tst_test.h"
static void verify_execlp(void)
{
pid_t pid;
pid = SAFE_FORK();
if (pid == 0) {
TEST(execlp("execlp01_chi... |
google | android | setpgrp02 | .c | platform/external/ltp/testcases/kernel/syscalls/setpgrp/setpgrp02.c | 3,041 | utf_8 | d59acddd16204e23ce4f11c0d1a6ddb5 | /*
*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* NAME
* setpgrp02.c
*
* DESCRIPTION
* Testcase to check the basic functionality of the setpgrp(2) syscall.
*
* ALGORITHM
* Check the values that setpgrp() and getpgrp() return. The setpgrp()
* returns 0 on success i... |
google | android | setpgrp01 | .c | platform/external/ltp/testcases/kernel/syscalls/setpgrp/setpgrp01.c | 2,570 | utf_8 | 6f56f914e02ed08840566fbdd07b890e | /*
* 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 | faccessat01 | .c | platform/external/ltp/testcases/kernel/syscalls/faccessat/faccessat01.c | 3,658 | utf_8 | 84123e42dba1532812679470d61114bb | /******************************************************************************
*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* NAME
* faccessat01.c
*
* DESCRIPTION
* This test case will verify basic function of faccessat
* added by kernel 2.6.16 or up.
*
* Author
... |
google | android | sched_getaffinity01 | .c | platform/external/ltp/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c | 2,117 | utf_8 | 4e9f86ca5b3c022cf312e9636ba71b9d | */
#define _GNU_SOURCE
#include <errno.h>
#include <sched.h>
#include <stdlib.h>
#include <string.h>
#include "tst_test.h"
#include "tst_safe_macros.h"
#include "lapi/cpuset.h"
static long ncpu;
static void *bad_addr;
static void errno_test(pid_t pid, size_t cpusize, void *mask, int exp_errno)
{
TEST(sched_getaffinit... |
google | android | mallinfo2_01 | .c | platform/external/ltp/testcases/kernel/syscalls/mallinfo2/mallinfo2_01.c | 1,098 | utf_8 | 8e070939e254e8f45efba52050580717 | */
/*\
* [Description]
*
* Basic mallinfo2() test.
*
* Test hblkhd member of struct mallinfo2 whether overflow when setting 2G size.
*
* Deprecated mallinfo() overflow in this case, that was the point for creating
* mallinfo2().
*/
#include "mallinfo_common.h"
#include "tst_safe_macros.h"
#ifdef HAVE_MALLINFO... |
google | android | request_key02 | .c | platform/external/ltp/testcases/kernel/syscalls/request_key/request_key02.c | 2,124 | utf_8 | c9246f3398029094bd27a7c71a260abb | */
/*
* Test Name: request_key02
*
* Description:
* 1) request_key(2) fails if no matching key was found.
* 2) request_key(2) fails if A revoked key was found.
* 3) request_key(2) fails if An expired key was found.
*
* Expected Result:
* 1) request_key(2) should return -1 and set errno to ENOKEY.
* 2) reques... |
google | android | request_key05 | .c | platform/external/ltp/testcases/kernel/syscalls/request_key/request_key05.c | 824 | utf_8 | 698be85eef956fbc4442895f0773605f | */
/*
* Test for CVE-2017-6951, original reproducer can be found here:
* http://www.spinics.net/lists/keyrings/msg01845.html
*
* request_key() is not in glibc, so we just use the syscall directly instead
* of linking to keyutils.
*/
#include <unistd.h>
#include <sys/syscall.h>
#include "tst_test.h"
#include "lap... |
google | android | request_key03 | .c | platform/external/ltp/testcases/kernel/syscalls/request_key/request_key03.c | 7,036 | utf_8 | 7db3c1ab3d98de11fef9f21798a109df | */
/*
* Regression test for two related bugs:
*
* (1) CVE-2017-15299, fixed by commit 60ff5b2f547a ("KEYS: don't let add_key()
* update an uninstantiated key")
* (2) CVE-2017-15951, fixed by commit 363b02dab09b ("KEYS: Fix race between
* updating and finding a negative key")
*
* We test for the bugs to... |
google | android | request_key01 | .c | platform/external/ltp/testcases/kernel/syscalls/request_key/request_key01.c | 1,139 | utf_8 | 7b8b1a38bff305ab8edb7ce5998b0ea5 | */
/*
* Test Name: request_key01
*
* Description:
* The testcase checks basic functionality of the request_key(2).
* request_key(2) asks the kernel to find a key which matches the
* specified description. If successful, it attaches it to the
* nominated keyring and returns its serial number.
*
*/
#include <er... |
google | android | request_key04 | .c | platform/external/ltp/testcases/kernel/syscalls/request_key/request_key04.c | 2,277 | utf_8 | 5e52e2d7e47d989ec7035281de775442 | */
/*
* Regression test for commit 4dca6ea1d943 ("KEYS: add missing permission check
* for request_key() destination"), or CVE-2017-17807. This bug allowed adding
* a key to a keyring given only Search permission to that keyring, rather than
* the expected Write permission.
*
* We test for the bug by trying to ... |
google | android | clock_gettime01 | .c | platform/external/ltp/testcases/kernel/syscalls/clock_gettime/clock_gettime01.c | 3,117 | utf_8 | 77b8b244c3eb73ba637baa9ef96e2441 | */
/*
* Basic test for clock_gettime(2) on multiple clocks:
*
* 1) CLOCK_REALTIME
* 2) CLOCK_MONOTONIC
* 3) CLOCK_PROCESS_CPUTIME_ID
* 4) CLOCK_THREAD_CPUTIME_ID
* 5) CLOCK_REALTIME_COARSE
* 6) CLOCK_MONOTONIC_COARSE
* 7) CLOCK_MONOTONIC_RAW
* 8) CLOCK_BOOTTIME
*/
#include "config.h"
#include "time6... |
google | android | clock_gettime02 | .c | platform/external/ltp/testcases/kernel/syscalls/clock_gettime/clock_gettime02.c | 3,138 | utf_8 | 7b7b2abb0d3357b1e94d0ab69eecceca | */
/*
* Bad argument tests for clock_gettime(2) on multiple clocks:
*
* 1) MAX_CLOCKS
* 2) MAX_CLOCKS + 1
* 3) CLOCK_REALTIME
* 4) CLOCK_MONOTONIC
* 5) CLOCK_PROCESS_CPUTIME_ID
* 6) CLOCK_THREAD_CPUTIME_ID
* 7) CLOCK_REALTIME_COARSE
* 8) CLOCK_MONOTONIC_COARSE
* 9) CLOCK_MONOTONIC_RAW
* 10) CLOCK_... |
google | android | clock_gettime03 | .c | platform/external/ltp/testcases/kernel/syscalls/clock_gettime/clock_gettime03.c | 3,755 | utf_8 | f3939eba8b9994354f9de24d9b68acce | */
/*
* [Description]
*
* After a call to unshare(CLONE_NEWTIME) a new timer namespace is created, the
* process that has called the unshare() can adjust offsets for CLOCK_MONOTONIC
* and CLOCK_BOOTTIME for its children by writing to the '/proc/self/timens_offsets'.
*
* The child processes also switch to the in... |
google | android | leapsec01 | .c | platform/external/ltp/testcases/kernel/syscalls/clock_gettime/leapsec01.c | 5,026 | utf_8 | 9324b0bec8e088b2e2641dd4bdd3cd83 | */
/*
* Regression test for hrtimer early expiration during and after leap seconds
*
* A bug in the hrtimer subsystem caused all TIMER_ABSTIME CLOCK_REALTIME
* timers to expire one second early during leap second.
* See http://lwn.net/Articles/504658/.
*
* This is a regression test for the bug.
*
* Note: runn... |
google | android | clock_gettime04 | .c | platform/external/ltp/testcases/kernel/syscalls/clock_gettime/clock_gettime04.c | 5,215 | utf_8 | 98817e630127ea63a618fa83fa21a1b2 | * Date: Wed Mar 24 20:23:55 2021 +0100
*
* s390/vdso: fix initializing and updating of vdso_data
*/
#include "config.h"
#include "parse_vdso.h"
#include "time64_variants.h"
#include "tst_timer.h"
#include "tst_safe_clocks.h"
clockid_t clks[] = {
CLOCK_REALTIME,
CLOCK_REALTIME_COARSE,
CLOCK_MONOTONIC,
CL... |
google | android | msync03 | .c | platform/external/ltp/testcases/kernel/syscalls/msync/msync03.c | 3,995 | utf_8 | 3a7496ca53fbdad5076a96c9bf23f6e8 | /*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/*
* Description:
* Verify that,
* 1. msync() fails with -1 return value and sets errno to EBUSY
* if MS_INVALIDATE was specified in flags, and a memory lock
* exists for the specified address range.
* 2. msync() fails with -1 return ... |
google | android | msync04 | .c | platform/external/ltp/testcases/kernel/syscalls/msync/msync04.c | 2,517 | utf_8 | 3cf9af70796cf9181d0e1e52dfb6020b | *
*/
/*
* Test description: Verify msync() after writing into mmap()-ed file works.
*
* Write to mapped region and sync the memory back with file. Check the page
* is no longer dirty after msync() call.
*/
#include <errno.h>
#include "tst_test.h"
static int test_fd;
static char *mmaped_area;
static long pagesize... |
google | android | msync02 | .c | platform/external/ltp/testcases/kernel/syscalls/msync/msync02.c | 4,409 | utf_8 | a692efd7b774b9be1e958a8985c71063 | /*
*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* Test Name: msync02
*
* Test Description:
* Verify that msync() succeeds when the region to synchronize is mapped
* shared and the flags argument is MS_INVALIDATE.
*
* Expected Result:
* msync() should succeed wit... |
google | android | msync01 | .c | platform/external/ltp/testcases/kernel/syscalls/msync/msync01.c | 5,326 | utf_8 | 6c85356809bfa11295075e8754923aa1 | /*
*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* Test Name: msync01
*
* Test Description:
* Verify that, msync() succeeds, when the region to synchronize, is part
* of, or all of a mapped region.
*
* Expected Result:
* msync() should succeed with a return value... |
google | android | setsid01 | .c | platform/external/ltp/testcases/kernel/syscalls/setsid/setsid01.c | 4,413 | utf_8 | a6622747326b4268abdf6e16cd13b1e1 | /*
*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* NAME
* setsid01.c
*
* DESCRIPTION
* Test to check the error and trivial conditions in setsid system call
*
* USAGE
* setsid01
*
* RESTRICTIONS
* This test doesn't follow good LTP format - PLEASE FIX!
*/
#inc... |
google | android | socket01 | .c | platform/external/ltp/testcases/kernel/syscalls/socket/socket01.c | 1,649 | utf_8 | 2b9081a95ea8d11aad82abddb3439246 | */
/*
* Test Name: socket01
*
* Test Description:
* Verify that socket() 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"
struct test_case_t {... |
google | android | socket02 | .c | platform/external/ltp/testcases/kernel/syscalls/socket/socket02.c | 1,506 | utf_8 | a320c399a9f81b849f01887c53b1a298 | */
/*
* Test Name: socket02
*
* Description:
* This program tests the new flag SOCK_CLOEXEC and SOCK_NONBLOCK introduced
* in socket() in kernel 2.6.27.
*/
#include <stdio.h>
#include <unistd.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include "lapi/fcntl.h"
#include "tst_test.h"
static int fd;
static struct tc... |
google | android | copy_file_range02 | .c | platform/external/ltp/testcases/kernel/syscalls/copy_file_range/copy_file_range02.c | 6,991 | utf_8 | d61c4a558646e9cdb253a911d866b8f4 | */
/*
* Tests basic error handling of the
* copy_file_range syscall
*
* 1) Try to copy contents to file open as readonly
* -> EBADF
* 2) Try to copy contents to directory -> EISDIR
* 3) Try to copy contents to a file opened with the
* O_APPEND flag -> EBADF
* 4) Try to copy contents to closed file descr... |
google | android | copy_file_range01 | .c | platform/external/ltp/testcases/kernel/syscalls/copy_file_range/copy_file_range01.c | 5,515 | utf_8 | 83499ae87632bd92bc3f1df9a856b039 | * another using various different combinations for length and
* input/output offsets.
*
* After a copy is done this test checks if the contents of both files
* are equal at the given offsets. It is also inspected if the offsets
* of the file descriptors are advanced correctly.
*/
#define _GNU_SOURCE
#include "ts... |
google | android | copy_file_range03 | .c | platform/external/ltp/testcases/kernel/syscalls/copy_file_range/copy_file_range03.c | 1,759 | utf_8 | d158c1fcb2098a0523f26cd754e8d4d9 | * checks if the timestamp gets updated in the process.
*/
#define _GNU_SOURCE
#include "tst_test.h"
#include "tst_timer.h"
#include "copy_file_range.h"
static int fd_src;
static int fd_dest;
struct timespec get_timestamp(int fd)
{
struct stat filestat;
fstat(fd, &filestat);
return filestat.st_mtim;
}
static void v... |
google | android | migrate_pages03 | .c | platform/external/ltp/testcases/kernel/syscalls/migrate_pages/migrate_pages03.c | 3,688 | utf_8 | 83cf02b9f8ee4881f19b4e98a76bef43 | * Date: Fri Mar 31 15:11:44 2017 -0700
*
* mm: migrate: fix remove_migration_pte() for ksm pages
*/
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
#include <pwd.h>
#include "tst_test.h"
#include "lapi/syscalls.h"
#include "lapi/mmap.h"
#include "ksm_helper.h"
#include "numa_helper.h"
#include "mig... |
google | android | migrate_pages01 | .c | platform/external/ltp/testcases/kernel/syscalls/migrate_pages/migrate_pages01.c | 6,429 | utf_8 | 83a23b2dd00ba668c0670fc060c93686 | /*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
/*
* errno tests for migrate_pages() syscall
*/
#include <sys/types.h>
#include <sys/syscall.h>
#include <sys/wait.h>
#include <sys/mman.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include... |
google | android | migrate_pages_common | .c | platform/external/ltp/testcases/kernel/syscalls/migrate_pages/migrate_pages_common.c | 1,983 | utf_8 | a745fe441e319a03d66fd6a277d6089c | /*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
#include "test.h"
#include "migrate_pages_common.h"
void set_bit(unsigned long *b, unsigned int n, unsigned int v)
{
if (v)
b[n / bitsperlong] |= 1UL << (n % bitsperlong);
else
b[n / bitsperlong] &= ~(1UL << (n % bitsperlo... |
google | android | migrate_pages02 | .c | platform/external/ltp/testcases/kernel/syscalls/migrate_pages/migrate_pages02.c | 8,640 | utf_8 | 7cfd132c28a7f66d170ce744f1bfb3ac | */
/*
* use migrate_pages() and check that address is on correct node
* 1. process A can migrate its non-shared mem with CAP_SYS_NICE
* 2. process A can migrate its non-shared mem without CAP_SYS_NICE
* 3. process A can migrate shared mem only with CAP_SYS_NICE
* 4. process A can migrate non-shared mem in process... |
google | android | accept4_01 | .c | platform/external/ltp/testcases/kernel/syscalls/accept4/accept4_01.c | 4,045 | utf_8 | 19d4cdc0e38c00cdedc9274283e4068a | */
#define _GNU_SOURCE
#include <unistd.h>
#include <sys/syscall.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <linux/net.h>
#include "tst_test.h"
#include "lapi/fcntl.h"
#include "lapi/syscalls.h"
static const char *variant_de... |
google | android | set_mempolicy01 | .c | platform/external/ltp/testcases/kernel/syscalls/set_mempolicy/set_mempolicy01.c | 2,904 | utf_8 | 208620a4f2be34b158351d76d03cd184 | */
/*
* We are testing set_mempolicy() with MPOL_BIND and MPOL_PREFERRED.
*
* For each node with memory we set its bit in nodemask with set_mempolicy()
* and verify that memory has been allocated accordingly.
*/
#include <errno.h>
#include "config.h"
#ifdef HAVE_NUMA_V2
# include <numa.h>
# include <numaif.h>
#en... |
google | android | set_mempolicy04 | .c | platform/external/ltp/testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c | 3,669 | utf_8 | be8e7e6645eb31581b9c85b554d5adfc | */
/*
* We are testing set_mempolicy() with MPOL_INTERLEAVE on mmaped buffers backed
* by files.
*
* Apparently it takes a larger sample for the allocations to be correctly
* interleaved. The reason for this is that buffers for file metadata are
* allocated in batches in order not to loose performance. Also the ... |
google | android | set_mempolicy02 | .c | platform/external/ltp/testcases/kernel/syscalls/set_mempolicy/set_mempolicy02.c | 2,603 | utf_8 | d026a81fa7c024a3f4d7a981650d9e3e | */
/*
* We are testing set_mempolicy() with MPOL_INTERLEAVE.
*
* The test tries different subsets of memory nodes, sets the mask with
* memopolicy, and checks that the memory was interleaved between the nodes
* accordingly.
*/
#include <errno.h>
#include "config.h"
#ifdef HAVE_NUMA_V2
# include <numa.h>
# includ... |
google | android | set_mempolicy05 | .c | platform/external/ltp/testcases/kernel/syscalls/set_mempolicy/set_mempolicy05.c | 3,454 | utf_8 | ece279147cb75983fab91e6bd605809e | */
/*\
*
* [Description]
*
* This will reproduce an information leak in the set_mempolicy 32-bit
* compat syscall. The catch is that the 32-bit compat syscall is not
* used in x86_64 upstream. So at the time of writing, 32-bit programs
* on large x86_64 numa systems will be broken if they use
* set_mempolicy. ... |
google | android | set_mempolicy03 | .c | platform/external/ltp/testcases/kernel/syscalls/set_mempolicy/set_mempolicy03.c | 2,380 | utf_8 | 1f6c13d8ad0252a7f34e2bf8307a01d1 | */
/*
* We are testing set_mempolicy() with MPOL_BIND and MPOL_PREFERRED backed by a
* file on each supported filesystem.
*/
#include <errno.h>
#include "config.h"
#ifdef HAVE_NUMA_V2
# include <numaif.h>
# include <numa.h>
#endif
#include "tst_test.h"
#include "tst_numa.h"
#define MNTPOINT "mntpoint"
#define PAGES... |
google | android | mount05 | .c | platform/external/ltp/testcases/kernel/syscalls/mount/mount05.c | 2,966 | utf_8 | f1a658432760270e5f91808be9089888 | /*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
/*
* DESCRIPTION
* Test for feature MS_BIND of mount.
* "Perform a bind mount, making a file or a directory subtree visible
* at another point within a file system."
*/
#include <errno.h>
#include <sys/mount.h>
#include <sys/types.h>
#inclu... |
google | android | mount01 | .c | platform/external/ltp/testcases/kernel/syscalls/mount/mount01.c | 2,208 | utf_8 | 1c9162e7aff27f0758c183dc46d6fcad | /*
*
* DESCRIPTION
* This is a Phase I test for the mount(2) system call.
* It is intended to provide a limited exposure of the system call.
*/
#include <errno.h>
#include <sys/mount.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "test.h"
#include "safe_macros.h"
static void setup(void);
static void c... |
google | android | mount03 | .c | platform/external/ltp/testcases/kernel/syscalls/mount/mount03.c | 6,142 | utf_8 | 9da749c8df2735e71d7ce1c4f6cbf887 | */
/*\
* [Description]
*
* Check mount(2) system call with various flags.
*
* Verify that mount(2) syscall passes for each flag setting and validate
* the flags:
*
* - MS_RDONLY - mount read-only
* - MS_NODEV - disallow access to device special files
* - MS_NOEXEC - disallow program execution
* - MS_REMOUNT... |
google | android | mount02 | .c | platform/external/ltp/testcases/kernel/syscalls/mount/mount02.c | 5,403 | utf_8 | 493262b6dc198f6e1dcc114e0cead3fe | /*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
/*
DESCRIPTION
Check for basic errors returned by mount(2) system call.
Verify that mount(2) returns -1 and sets errno to
1) ENODEV if filesystem type not configured
2) ENOTBLK if specialfile is not a block device
3) EBUSY if specialfile i... |
google | android | mount03_suid_child | .c | platform/external/ltp/testcases/kernel/syscalls/mount/mount03_suid_child.c | 449 | utf_8 | 9a2d79644f9a190126206de2e5739724 | */
/*
* SUID to root program invoked by a non-root process to validate the mount
* flag MS_NOSUID.
*/
#include <errno.h>
#include <unistd.h>
#define TST_NO_DEFAULT_MAIN
#include "tst_test.h"
int main(void)
{
tst_reinit();
TST_EXP_FAIL(setreuid(getuid(), 0), EPERM);
return 0;
} |
google | android | mount04 | .c | platform/external/ltp/testcases/kernel/syscalls/mount/mount04.c | 2,608 | utf_8 | 7e029214ed6868de69b3347e634e1506 | /*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* DESCRIPTION
* Verify that mount(2) returns -1 and sets errno to EPERM if the user
* is not the super-user.
*/
#include <errno.h>
#include <sys/mount.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <pwd.h>
#include "t... |
google | android | mount06 | .c | platform/external/ltp/testcases/kernel/syscalls/mount/mount06.c | 3,659 | utf_8 | 00cb219044f253650cc02fcb31804ba2 | /*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
/*
* DESCRIPTION
* Test for feature MS_MOVE of mount(2).
* "Move an existing mount point to the new location."
*/
#include <errno.h>
#include <sys/mount.h>
#include <unistd.h>
#include <fcntl.h>
#include "test.h"
#include "safe_macros.h"
#ifn... |
google | android | dup203 | .c | platform/external/ltp/testcases/kernel/syscalls/dup2/dup203.c | 2,247 | utf_8 | 813de4252d53e578e903fa741c33597b | * 07/2001 Ported by Wayne Boyer
*/
/*\
* [Description]
*
* Testcase to check the basic functionality of dup2().
*
* - Attempt to dup2() on an open file descriptor.
* - Attempt to dup2() on a close file descriptor.
*/
#include <errno.h>
#include <stdio.h>
#include <unistd.h>
#include "tst_test.h"
#include "tst_... |
google | android | dup204 | .c | platform/external/ltp/testcases/kernel/syscalls/dup2/dup204.c | 901 | utf_8 | 673ff47b1a81ebc743f1c9f61374e6f0 | */
/*\
* [Description]
*
* Test whether the inode number are the same for both file descriptors.
*/
#include <unistd.h>
#include "tst_test.h"
#include "tst_safe_macros.h"
static int fd[2] = {-1, -1};
static int nfd[2] = {10, 20};
static void setup(void)
{
SAFE_PIPE(fd);
}
static void cleanup(void)
{
unsigned int... |
google | android | dup201 | .c | platform/external/ltp/testcases/kernel/syscalls/dup2/dup201.c | 1,068 | utf_8 | 32885956f6b14b8800a3e062a1dfa431 | * 07/2001 Ported by Wayne Boyer
* 01/2002 Removed EMFILE test - Paul Larson
*/
/*\
* [Description]
*
* Negative tests for dup2() with bad fd (EBADF).
*
* - First fd argument is less than 0
* - First fd argument is getdtablesize()
* - Second fd argument is less than 0
* - Second fd argument is getdtablesize()... |
google | android | dup206 | .c | platform/external/ltp/testcases/kernel/syscalls/dup2/dup206.c | 954 | utf_8 | 6234646a5d337438704e695c6d6ee65f | */
/*\
* [Description]
*
* If oldfd is a valid file descriptor, and newfd has the same value as oldfd,
* then dup2() does nothing, and returns newfd.
*/
#include <stdio.h>
#include <unistd.h>
#include "tst_test.h"
static int fd = -1;
static void verify_dup2(void)
{
TST_EXP_FD_SILENT(dup2(fd, fd), "dup2(%d, %d)",... |
google | android | dup207 | .c | platform/external/ltp/testcases/kernel/syscalls/dup2/dup207.c | 1,710 | utf_8 | 8e41b430e7d8149a440667639ed6ca75 | */
/*\
* [Description]
*
* Test whether the file offset are the same for both file descriptors.
*/
#include <errno.h>
#include <stdio.h>
#include <unistd.h>
#include "tst_test.h"
#include "tst_safe_macros.h"
#define WRITE_STR "abcdefg"
static int ofd = -1, nfd = 10;
static struct tcase {
off_t offset;
size_t exp... |
google | android | dup202 | .c | platform/external/ltp/testcases/kernel/syscalls/dup2/dup202.c | 2,615 | utf_8 | b67358f4ae10d1d5c25a1d6ac9a3e48c | * 07/2001 Ported by Wayne Boyer
*/
/*\
* [Description]
*
* Test whether the access mode are the same for both file descriptors.
*
* Create file with mode, dup2, [change mode], check mode
*
* - read only, dup2, read only ? "0444"
* - write only, dup2, write only ? "0222"
* - read/write, dup2 read/write ? "066... |
google | android | dup205 | .c | platform/external/ltp/testcases/kernel/syscalls/dup2/dup205.c | 1,768 | utf_8 | 5117e56d9ee9611593bbf39bad109b13 | * Ported from SPIE, section2/iosuite/dup6.c, by Airong Zhang
*/
/*\
* [Description]
*
* Negative test for dup2() with max open file descriptors.
*/
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include "tst_test.h"
#include "tst_safe_macros.h"
static int *fildes;
static int min;
static char pfilname... |
google | android | clock_settime03 | .c | platform/external/ltp/testcases/kernel/syscalls/clock_settime/clock_settime03.c | 3,144 | utf_8 | 29c705874347eafa5d27b370d53abc98 | *
* Check Year 2038 related vulnerabilities.
*/
#include <signal.h>
#include "config.h"
#include "time64_variants.h"
#include "tst_timer.h"
#include "tst_safe_clocks.h"
#define TIMER_DELTA 3
#define ALLOWED_DELTA (50 * 1000) /* 50 ms */
static struct tst_ts start, end;
static struct tst_its its;
static struct time64... |
google | android | clock_settime01 | .c | platform/external/ltp/testcases/kernel/syscalls/clock_settime/clock_settime01.c | 3,244 | utf_8 | f0f872a0e5bc201bcd3962d242bad3e4 | */
/*
* Basic test for clock_settime(2) on REALTIME clock:
*
* 1) advance DELTA_SEC seconds
* 2) go backwards DELTA_SEC seconds
*
* Restore wall clock at the end of test.
*/
#include "config.h"
#include "time64_variants.h"
#include "tst_timer.h"
#include "tst_safe_clocks.h"
#define DELTA_SEC 10
#defin... |
google | android | clock_settime02 | .c | platform/external/ltp/testcases/kernel/syscalls/clock_settime/clock_settime02.c | 3,968 | utf_8 | 91390c4a3692c2facc780aad84d2d790 | */
/*
* Basic tests for errors of clock_settime(2) on different clock types.
*/
#include "config.h"
#include "time64_variants.h"
#include "tst_timer.h"
#include "tst_safe_clocks.h"
#define DELTA_SEC 10
static void *bad_addr;
struct test_case {
clockid_t type;
int exp_err;
int replace;
long tv_sec;
long tv_nsec;... |
google | android | epoll_wait02 | .c | platform/external/ltp/testcases/kernel/syscalls/epoll_wait/epoll_wait02.c | 1,317 | utf_8 | 7143aea629bc15e336f0f5f48fc37a4f | */
/*\
* [Description]
*
* Check that epoll_wait(2) timeouts correctly.
*/
#include <sys/epoll.h>
#include <unistd.h>
#include <errno.h>
#include "tst_timer_test.h"
static int epfd, fds[2];
static struct epoll_event epevs[1] = {
{.events = EPOLLIN}
};
int sample_fn(int clk_id, long long usec)
{
unsigned int slee... |
google | android | epoll_wait01 | .c | platform/external/ltp/testcases/kernel/syscalls/epoll_wait/epoll_wait01.c | 4,884 | utf_8 | 62a5b1e5979ea74e1b68c45dde75a099 | */
/*\
* [Description]
*
* Basic test for epoll_wait. Check that epoll_wait works for EPOLLOUT and
* EPOLLIN events on an epoll instance and that struct epoll_event is set
* correctly.
*/
#include <sys/epoll.h>
#include <poll.h>
#include <string.h>
#include <errno.h>
#include "tst_test.h"
static int write_size, ... |
google | android | epoll_wait03 | .c | platform/external/ltp/testcases/kernel/syscalls/epoll_wait/epoll_wait03.c | 2,180 | utf_8 | d245726cdd5ed4af84aca290d6b3e973 | */
/*\
* [Description]
*
* Basic test for epoll_wait:
*
* - epoll_wait fails with EBADF if epfd is not a valid file descriptor.
* - epoll_wait fails with EINVAL if epfd is not an epoll file descriptor.
* - epoll_wait fails with EINVAL if maxevents is less than zero.
* - epoll_wait fails with EINVAL if maxevent... |
google | android | epoll_wait04 | .c | platform/external/ltp/testcases/kernel/syscalls/epoll_wait/epoll_wait04.c | 1,480 | utf_8 | dd24a89d72659cfc3b55546994f6f150 | */
/*\
* [Description]
*
* Check that a timeout equal to zero causes epoll_wait() to return immediately.
*/
#include <sys/epoll.h>
#include "tst_test.h"
#include "tst_timer_test.h"
#define USEC_PRECISION 1000 /* Error margin allowed in usec */
static int epfd, fds[2];
static struct epoll_event epevs[1] = {
{.even... |
google | android | open_tree02 | .c | platform/external/ltp/testcases/kernel/syscalls/open_tree/open_tree02.c | 1,299 | utf_8 | 2f62dc5d341397d574b6870a2748a385 | *
* Basic open_tree() failure tests.
*/
#include "tst_test.h"
#include "lapi/fsmount.h"
#define MNTPOINT "mntpoint"
static struct tcase {
char *name;
int dirfd;
const char *pathname;
unsigned int flags;
int exp_errno;
} tcases[] = {
{"invalid-fd", -1, MNTPOINT, OPEN_TREE_CLONE, EBADF},
{"invalid-path", AT_FDC... |
google | android | open_tree01 | .c | platform/external/ltp/testcases/kernel/syscalls/open_tree/open_tree01.c | 1,491 | utf_8 | 272b898c8d44a9ed7c030270d58f38c5 | *
* Basic open_tree() test.
*/
#include "tst_test.h"
#include "lapi/fsmount.h"
#define MNTPOINT "mntpoint"
#define OT_MNTPOINT "ot_mntpoint"
#define TCASE_ENTRY(_flags) {.name = "Flag " #_flags, .flags = _flags}
static struct tcase {
char *name;
unsigned int flags;
} tcases[] = {
TCASE_ENTRY(OPEN_TREE_CLONE),
TC... |
google | android | statx05 | .c | platform/external/ltp/testcases/kernel/syscalls/statx/statx05.c | 2,902 | utf_8 | 7f28f32103ee11efc41dcf48cabe589b | */
/*\
* [Description]
*
* Test statx syscall with STATX_ATTR_ENCRYPTED flag, setting a key is required
* for the file to be encrypted by the filesystem.
*
* e4crypt is used to set the encrypt flag (currently supported only by ext4).
*
* Two directories are tested.
* First directory has all flags set.
* Seco... |
google | android | statx07 | .c | platform/external/ltp/testcases/kernel/syscalls/statx/statx07.c | 4,365 | utf_8 | 73ce67ef40e79bf74cdf4bc95fa2c80e | */
/*\
* [Description]
*
* This code tests the following flags:
*
* - AT_STATX_FORCE_SYNC
* - AT_STATX_DONT_SYNC
*
* By exportfs cmd creating NFS setup.
*
* A test file is created in server folder and statx is being
* done in client folder.
*
* BY AT_STATX_SYNC_AS_STAT getting predefined mode value.
* Th... |
google | android | statx09 | .c | platform/external/ltp/testcases/kernel/syscalls/statx/statx09.c | 3,769 | utf_8 | 09fe81a8cdd1aa3b2a0f7f8f013af19d | */
/*\
* [Description]
*
* This code tests if STATX_ATTR_VERITY flag in the statx attributes is set correctly.
*
* The statx() system call sets STATX_ATTR_VERITY if the file has fs-verity
* enabled. This can perform better than FS_IOC_GETFLAGS and
* FS_IOC_MEASURE_VERITY because it doesn't require opening the f... |
google | android | statx02 | .c | platform/external/ltp/testcases/kernel/syscalls/statx/statx02.c | 2,719 | utf_8 | 1df211fffee48484be10fc1730c155eb | */
/*\
* [Description]
*
* This code tests the following flags with statx syscall:
*
* - AT_EMPTY_PATH
* - AT_SYMLINK_NOFOLLOW
*
* A test file and a link for it is created.
*
* To check empty path flag, test file fd alone is passed.
* Predefined size of testfile is checked against obtained value.
*
* To c... |
google | android | statx08 | .c | platform/external/ltp/testcases/kernel/syscalls/statx/statx08.c | 4,793 | utf_8 | e24d8d5718cf46952528cca127a33926 | */
/*\
* [Description]
*
* This case tests whether the attributes field of statx received expected value
* by using flags in the stx_attributes_mask field of statx.
* File set with following flags by using SAFE_IOCTL:
*
* - STATX_ATTR_COMPRESSED: The file is compressed by the filesystem.
* - STATX_ATTR_IMMUTAB... |
google | android | statx03 | .c | platform/external/ltp/testcases/kernel/syscalls/statx/statx03.c | 2,383 | utf_8 | ee436873c866953a4b24cd0dd00789e4 | */
/*\
* [Description]
*
* Test basic error handling of statx syscall:
*
* - EBADF - Bad file descriptor
* - EFAULT - Bad address
* - EINVAL - Invalid argument
* - ENOENT - No such file or directory
* - ENOTDIR - Not a directory
* - ENAMETOOLONG - Filename too long
*/
#define _GNU_SOURCE
#include <stdio.h>
... |
google | android | statx01 | .c | platform/external/ltp/testcases/kernel/syscalls/statx/statx01.c | 5,151 | utf_8 | deba1fbd7efe6a51e3f4c6f2c807fba6 | */
/*\
* [Description]
*
* This code tests the functionality of statx system call.
*
* The metadata for normal file are tested against expected values:
*
* - gid
* - uid
* - mode
* - blocks
* - size
* - nlink
* - mnt_id
*
* The metadata for device file are tested against expected values:
*
* - MAJOR n... |
google | android | statx04 | .c | platform/external/ltp/testcases/kernel/syscalls/statx/statx04.c | 3,863 | utf_8 | d3be6738cfa268bb1c94a06a5f22f7b7 | */
/*\
* [Description]
*
* Test whether the kernel properly advertises support for statx() attributes:
*
* - STATX_ATTR_COMPRESSED: The file is compressed by the filesystem.
* - STATX_ATTR_IMMUTABLE: The file cannot be modified.
* - STATX_ATTR_APPEND: The file can only be opened in append mode for writing.
* -... |
google | android | statx06 | .c | platform/external/ltp/testcases/kernel/syscalls/statx/statx06.c | 3,514 | utf_8 | ad1f827aee6fc62cb593e35b976e503f | */
/*\
* [Description]
*
* Test the following file timestamps of statx syscall:
*
* - btime - The time before and after the execution of the create system call is noted.
*
* - mtime - The time before and after the execution of the write system call is noted.
*
* - atime - The time before and after the executi... |
google | android | sched_get_priority_min02 | .c | platform/external/ltp/testcases/kernel/syscalls/sched_get_priority_min/sched_get_priority_min02.c | 643 | utf_8 | 177f4a9d62c8d1f33e83f927559c4525 | */
/*\
* [Description]
*
* Verify that given an invalid scheduling policy, sched_get_priority_min(2)
* returns -1 with errno EINVAL.
*/
#include <errno.h>
#include <sched.h>
#include "tst_test.h"
#include "lapi/syscalls.h"
#define SCHED_INVALID 1000
static void verif_sched_get_priority_min02(void)
{
TST_EXP_FAIL... |
google | android | sched_get_priority_min01 | .c | platform/external/ltp/testcases/kernel/syscalls/sched_get_priority_min/sched_get_priority_min01.c | 1,103 | utf_8 | ed0c0f7b6723370fd6bad89ab70042f3 | */
/*\
* [Description]
*
* Basic test for the sched_get_priority_min(2) system call.
*
* Obtain different minimum priority for different schedulling policies and
* compare them with the expected value.
*/
#define _GNU_SOURCE
#include <sched.h>
#include "tst_test.h"
#include "lapi/sched.h"
#define POLICY_DESC(x)... |
google | android | memfd_create_common | .c | platform/external/ltp/testcases/kernel/syscalls/memfd_create/memfd_create_common.c | 11,966 | utf_8 | 53370f1cf8eaec1d13ecc12cf8ea0794 | */
#define _GNU_SOURCE
#include <sys/types.h>
#include <sys/syscall.h>
#include <sys/uio.h>
#include <errno.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#define TST_NO_DEFAULT_MAIN
#include "tst_test.h"
#include "lapi/fallocate.h"
#include "lapi/fcntl.h"
#include "lapi/memfd.h"
#in... |
google | android | memfd_create03 | .c | platform/external/ltp/testcases/kernel/syscalls/memfd_create/memfd_create03.c | 4,467 | utf_8 | e113fb65a4b85dc6ceda8b0f1b86d3ff | */
/*
* Test: Validating memfd_create() with MFD_HUGETLB flag.
*
* Test case 1: --WRITE CALL IN HUGEPAGES TEST--
* Huge pages are write protected. Any writes to
* the file should return EINVAL error.
*
* Test case 2: --PAGE SIZE OF CREATED FILE TEST--
* Default huge page ... |
google | android | memfd_create02 | .c | platform/external/ltp/testcases/kernel/syscalls/memfd_create/memfd_create02.c | 2,548 | utf_8 | efc196da160dff2a3cfd02b7d9355658 | */
#define _GNU_SOURCE
#include <errno.h>
#include <tst_test.h>
#include "memfd_create_common.h"
static char buf[2048];
static char term_buf[2048];
static int available_flags;
static const struct tcase {
char *descr;
char *memfd_name;
int flags;
int memfd_create_exp_err;
} tcases[] = {
/*
* Test memfd_create()... |
google | android | memfd_create04 | .c | platform/external/ltp/testcases/kernel/syscalls/memfd_create/memfd_create04.c | 2,384 | utf_8 | c7d3826253869ea30b664013f09981ad | */
/*
* Test: Validating memfd_create() with MFD_HUGETLB and MFD_HUGE_x flags.
*
* Test cases: Attempt to create files in the hugetlbfs filesystem using
* different huge page sizes.
*
* Test logic: memfd_create() should return non-negative value (fd)
* if the system supports that particu... |
google | android | memfd_create01 | .c | platform/external/ltp/testcases/kernel/syscalls/memfd_create/memfd_create01.c | 7,043 | utf_8 | 175fafec650ed2b440c53e9c7a023ef9 | */
#define _GNU_SOURCE
#include <errno.h>
#include "tst_test.h"
#include "memfd_create_common.h"
/*
* Do few basic sealing tests to see whether setting/retrieving seals works.
*/
static void test_basic(int fd)
{
/* add basic seals */
CHECK_MFD_HAS_SEALS(fd, 0);
CHECK_MFD_ADD_SEALS(fd, F_SEAL_SHRINK | F_SEAL_WRITE... |
google | android | sched_rr_get_interval01 | .c | platform/external/ltp/testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval01.c | 2,446 | utf_8 | ce6510fac319fb69ba2b4c2a11270475 | *
* Gets round-robin time quantum by calling sched_rr_get_interval() and
* checks that the value is sane.
*
* It is also a regression test for kernel
* commit 975e155ed873 ("sched/rt: Show the 'sched_rr_timeslice' SCHED_RR
* timeslice tuning knob in milliseconds").
*/
#include "time64_variants.h"
#include "tst_... |
google | android | sched_rr_get_interval02 | .c | platform/external/ltp/testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval02.c | 1,913 | utf_8 | a9bc516482bf0535841cb78311973911 | *
* Verify that for a process with scheduling policy SCHED_FIFO,
* sched_rr_get_interval() writes zero into timespec structure
* for tv_sec & tv_nsec.
*/
#include "time64_variants.h"
#include "tst_timer.h"
#include "tst_sched.h"
static struct tst_ts tp;
static struct time64_variants variants[] = {
{ .sched_rr_get... |
google | android | sched_rr_get_interval03 | .c | platform/external/ltp/testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval03.c | 2,545 | utf_8 | 9c57b4d15d2fa69a0a2bcacd252a36a0 | *
* Verify that
* 1) sched_rr_get_interval() fails with errno set to EINVAL for an
* invalid pid
* 2) sched_rr_get_interval() fails with errno set to ESRCH if the
* process with specified pid does not exists
* 3) sched_rr_get_interval() fails with errno set to EFAULT if the
* address specified as... |
google | android | listxattr03 | .c | platform/external/ltp/testcases/kernel/syscalls/listxattr/listxattr03.c | 1,643 | utf_8 | 8f62e921148ecae0b18f50aeae262f7c | */
/*
* Test Name: listxattr03
*
* Description:
* An empty buffer of size zero can return the current size of the list
* of extended attribute names, which can be used to estimate a suitable buffer.
*/
#include "config.h"
#include <errno.h>
#include <sys/types.h>
#ifdef HAVE_SYS_XATTR_H
# include <sys/xattr.h>
#endif
#... |
google | android | listxattr01 | .c | platform/external/ltp/testcases/kernel/syscalls/listxattr/listxattr01.c | 1,677 | utf_8 | 18ab407859fc611629cf66bd91c29895 | */
/*
* Test Name: listxattr01
*
* Description:
* The testcase checks the basic functionality of the listxattr(2).
* listxattr(2) retrieves the list of extended attribute names
* associated with the file itself in the filesystem.
*
*/
#include "config.h"
#include <errno.h>
#include <sys/types.h>
#include <string.h>
#if... |
google | android | listxattr02 | .c | platform/external/ltp/testcases/kernel/syscalls/listxattr/listxattr02.c | 2,197 | utf_8 | 657db1d3ea89c98133985f7be8c97e98 | */
/*
* Test Name: listxattr02
*
* Description:
* 1) listxattr(2) fails if the size of the list buffer is too small
* to hold the result.
* 2) listxattr(2) fails if path is an empty string.
* 3) listxattr(2) fails when attempted to read from a invalid address.
* 4) listxattr(2) fails if path is longer than allowed.
*
*... |
google | android | mkdirat02 | .c | platform/external/ltp/testcases/kernel/syscalls/mkdirat/mkdirat02.c | 1,778 | utf_8 | 0ca7b205a27d993befdba1016b03f7a3 | */
/*
* DESCRIPTION
* check mkdirat() with various error conditions that should produce
* ELOOP and EROFS.
*/
#define _GNU_SOURCE
#include "tst_test.h"
#include "lapi/mkdirat.h"
#define MNT_POINT "mntpoint"
#define TEST_DIR "mntpoint/test_dir"
#define DIR_MODE (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP| \
S_IXGRP|S_IROT... |
google | android | mkdirat01 | .c | platform/external/ltp/testcases/kernel/syscalls/mkdirat/mkdirat01.c | 3,328 | utf_8 | aeefac86d0431c3a28dff874f3d0b2f1 | /******************************************************************************
*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* DESCRIPTION
* This test case will verify basic function of mkdirat
* added by kernel 2.6.16 or up.
*/
#define _GNU_SOURCE
#include <sys/types.h>... |
google | android | mremap04 | .c | platform/external/ltp/testcases/kernel/syscalls/mremap/mremap04.c | 6,987 | utf_8 | 66ed9428184828d1d5e661c16ad5e0de | /*
*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* Test Name: mremap04
*
* Test Description:
* Verify that,
* mremap() fails when used to expand the existing virtual memory mapped
* region to the requested size, if the memory area cannot be expanded at
* the c... |
google | android | mremap03 | .c | platform/external/ltp/testcases/kernel/syscalls/mremap/mremap03.c | 5,018 | utf_8 | def9d73606ae3d5d6f9701a9775d5b5b | /*
*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* Test Name: mremap03
*
* Test Description:
* Verify that,
* mremap() fails when used to expand the existing virtual memory mapped
* region to the requested size, if there already exists mappings that
* cover th... |
google | android | mremap05 | .c | platform/external/ltp/testcases/kernel/syscalls/mremap/mremap05.c | 6,208 | utf_8 | 6eb2e398837522060d1c963173c9dfe6 | /*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
/*
* Test Name: mremap05
*
* Test Description:
* Verify that MREMAP_FIXED fails without MREMAP_MAYMOVE.
* Verify that MREMAP_FIXED|MREMAP_MAYMOVE fails if target address
* is not page aligned.
* Verify that MREMAP_F... |
google | android | mremap01 | .c | platform/external/ltp/testcases/kernel/syscalls/mremap/mremap01.c | 6,811 | utf_8 | df6c3d57c1898cedbdf45fb303da3e9d | /*
*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* Test Name: mremap01
*
* Test Description:
* Verify that, mremap() succeeds when used to expand the existing
* virtual memory mapped region to the requested size where the
* virtual memory area was previously mapped... |
google | android | mremap02 | .c | platform/external/ltp/testcases/kernel/syscalls/mremap/mremap02.c | 4,811 | utf_8 | 026dbb2d043ad43e99d3a3e4c36b0dc7 | /*
*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* Test Name: mremap02
*
* Test Description:
* Verify that,
* mremap() fails when used to expand the existing virtual memory mapped
* region to the requested size, if the virtual memory area previously
* mapped w... |
google | android | madvise01 | .c | platform/external/ltp/testcases/kernel/syscalls/madvise/madvise01.c | 3,667 | utf_8 | 0424193a9825699b4a9d163363f55c45 | */
/*
* This is a test case for madvise(2) system call.
* It tests madvise(2) with combinations of advice values.
* No error should be returned.
*/
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/mount.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
... |
google | android | madvise08 | .c | platform/external/ltp/testcases/kernel/syscalls/madvise/madvise08.c | 4,661 | utf_8 | da1a6811394bb239a7edc0bb24df31ed | */
/*
* Check that memory marked with MADV_DONTDUMP is not included in a core dump
* and check that the same memory then marked with MADV_DODUMP is included in
* a core dump.
*
* In order to reliably find the core dump this test temporarily changes the
* system wide core_pattern setting. Meaning all core dumps w... |
google | android | madvise10 | .c | platform/external/ltp/testcases/kernel/syscalls/madvise/madvise10.c | 4,071 | utf_8 | c4c14fc214a8d91f88ffb129b53dba56 | */
/*
* test cases for madvise(2) system call, advise value as "MADV_WIPEONFORK".
*
* DESCRIPTION
* Present the child process with zero-filled memory in this
* range after a fork(2).
* The MADV_WIPEONFORK operation can be applied only to
* private anonymous pages.
* Within the child created by fork(2), the MAD... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.