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 | 8-4 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/8-4.c | 1,744 | utf_8 | 85a1324f7eeb2f2293cf4cb7a1d29135 | /*
* source tree.
*
* Test that timer_settime() will return ovalue.it_interval = the previous
* reload value.
* - set up a timer to expire in TIMERSEC seconds with reload value RELOADVAL
* - set up a new timer
* - ensure ovalue.it_interval = RELOADVAL
*
* For this test, signal SIGCONT will be used so that the ... |
google | android | 2-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/2-1.c | 3,626 | utf_8 | 5e63509e3645d2f32c96ee38615d9f6c | /*
* source tree.
*
* Test that timer_settime() resets the time until the next timer
* expiration to value.it_value if the timer was already armed.
*
* - set up a timer with value.it_value = V and value.it_interval > 0
* - ensure that timer expires correctly the first time
* - change time value to value.it_valu... |
google | android | 9-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/9-1.c | 3,334 | utf_8 | b102e22e9eb7655de9ef82d52d71a1ab | /*
* source tree.
*
* Test that timers are not allowed to expire before their scheduled
* time.
*
* Test for a variety of timer values on relative timers.
*
* For this test, signal SIGTOTEST will be used, clock CLOCK_REALTIME
* will be used.
*/
#include <time.h>
#include <signal.h>
#include <stdio.h>
#include... |
google | android | 1-2 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/1-2.c | 2,557 | utf_8 | 2ce8ce6296655905e38eb88827ec45b9 | /*
* source tree.
* Test that timer_settime() sets the time until the next timer
* expiration to value.it_value and arms the timer for a variety
* of value.it_value values.
*
* Same steps as in 1-1.c; however, this time for multiple
* value.it_value values.
*
* For this test, signal SIGTOTEST will be used, clo... |
google | android | 13-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/13-1.c | 3,173 | utf_8 | 103a40905b61314927e2b1e07f0c8755 | /*
* source tree.
*
* Test that timer_settime() sets errno = EINVAL if:
* - value.it_value is not = 0 (so disabled)
* AND
* - value.*.it_nsec < 0
* or
* - value.*.it_nsec >= 1000 million
* This includes standard boundary tests.
*
* Signal SIGTOTEST is used.
* Clock CLOCK_REALTIME is used.
*/
#include <time... |
google | android | 3-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/3-1.c | 2,212 | utf_8 | 60b2815d7d3cc74262f580032aae2c15 | /*
* source tree.
* Test that if value.it_value = 0, the timer is disarmed.
* Steps:
* 1. Set up sigevent structure to send signal SIGTOTEST on timer
* expiration.
* 2. Set up sigaction structure to catch signal SIGTOTEST on timer
* expiration
* 3. Create timer using timer_create().
* 4. Activate t... |
google | android | 5-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/5-1.c | 2,601 | utf_8 | 9fb08286037af9cbad8e65e0553df557 | /*
* source tree.
* Test that timer_settime() uses an absolute clock if TIMER_ABSTIME is
* set in flags.
*
* Uses the same steps as 1-1.c to determine how long the timer lasted.
* In order to use an absolute clock, the timer time is determined by:
* - Get current time.
* - Set the timer to TIMERSEC+current time... |
google | android | 1-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/1-1.c | 2,630 | utf_8 | c7f632c87f34b4afbcf173ee13b16109 | /*
* source tree.
* Test that timer_settime() sets the time until the next timer
* expiration to value.it_value and arms the timer.
* Test is identical to timer_create() 1-1.c.
* Steps:
* 1. Set up sigevent structure to send signal SIGTOTEST on timer
* expiration.
* 2. Set up sigaction structure to catch ... |
google | android | 8-2 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/8-2.c | 2,210 | utf_8 | 794f9f807a4770ffd51d84624556e474 | /*
* source tree.
*
* Test that timer_settime() will return ovalue.it_value = 0
* and ovalue.it_interval = 0 if
* the timer was previously disarmed because it had just expired with
* no repeating interval.
*
* For this test, signal SIGCONT will be used so that the test will
* not abort. Clock CLOCK_REALTIME w... |
google | android | 8-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/8-1.c | 1,718 | utf_8 | be58eab28b299a88f42e63eb4f0d59d0 | /*
* source tree.
*
* Test that timer_settime() will return ovalue.it_value = 0
* and ovalue.it_interval = 0 if the timer was previously disarmed
* because it had just been created.
*
* For this test, signal SIGCONT will be used so that the test will
* not abort. Clock CLOCK_REALTIME will be used.
*/
#include... |
google | android | 6-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/6-1.c | 3,828 | utf_8 | ff475d097aa390e5fb8a609d6eff4a53 | /*
* source tree.
*
* Test that if value.it_interval != 0, the timer is periodic and loaded
* according to value.it_interval.
*
* - Set up a timer with an it_value < it_interval.
* - Check that after it_value seconds, the timer expires.
* - Check that after it_interval more seconds, the timer expires again (2X)... |
google | android | 12-3 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/speculative/12-3.c | 1,483 | utf_8 | 2d880672d5760b9ea23c12cf4596cfd8 | /*
* source tree.
*
* Test to see if timer_settime() sets errno = EINVAL when timerid =
* a timer ID of a deleted timer. Since this is a "may" assertion, either
* way is a pass.
*
* For this test, signal SIGTOTEST will be used.
* Clock CLOCK_REALTIME will be used.
*/
#include <time.h>
#include <signal.h>
#inc... |
google | android | 12-2 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/speculative/12-2.c | 1,459 | utf_8 | 3bb51f3994450bd52bcada10789dc09a | /*
* source tree.
*
* Test to see if timer_settime() sets errno = EINVAL timerid != a timer ID
* created via timer_create(). [Try to set timerid to a timer ID
* created + 1.] Since this test is a "may" assertion, either way is a
* pass.
*
* For this test, signal SIGTOTEST will be used, clock CLOCK_REALTIME
*... |
google | android | 12-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/speculative/12-1.c | 1,072 | utf_8 | d8ef85aa77833bfd7241d39beb46ab62 | /*
* source tree.
*
* Test to see if timer_settime() sets errno = EINVAL if no timers have been
* created yet. Since this is a "may" assertion, either way is a pass.
*/
#include <time.h>
#include <stdio.h>
#include <errno.h>
#include "posixtest.h"
#define BOGUSTID 9999
int main(void)
{
timer_t tid;
struct itime... |
google | android | 7-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/7-1.c | 2,144 | utf_8 | 96bfc511eedea9c32688e31ed19e0f9b | /*
* source tree.
This program tests the assertion that if SA_SIGINFO is set, then the
signal shall be queued to the receiving process and that sigqueue returns 0.
Steps:
- Register for myhandler to be called when SIGTOTEST is called, and make
sure SA_SIGINFO is set.
- Block signal SIGTOTEST from the process.
... |
google | android | 2-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/2-1.c | 2,089 | utf_8 | acd61d7b6dcd982881cda299a9abb621 | /*
* source tree.
This program tests the assertion that the lowest pending signal will be
selected by sigwaitinfo() if there are any multiple pending signals in the
range SIGRTMIN to SIGRTMAX.
Steps:
- Register for myhandler to be called when any signal between SIGRTMIN
and SIGRTMAX is generated, and make sure... |
google | android | 9-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/9-1.c | 1,500 | utf_8 | 2edf535afaefbdef29d9533988d822c7 | /*
* source tree.
* Test that the sigwaitinfo() function shall return the selected signal
number.
Steps:
1. Register signal SIGTOTEST with the handler myhandler
2. Block SIGTOTEST from the process
3. Raise the signal, causing it to be pending
4. Call sigwaitinfo() and verify that it returns t... |
google | android | 3-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/3-1.c | 2,310 | utf_8 | d079d0193d1e45c85fdc88f1bd6a0cfb | /*
* source tree.
* This program tests the assertion that if sigwaitinfo() was called and that
no signal in set was pending at the time of the call, then sigwaitinfo()
shall be suspended until a signal in set becomes pending.
Steps:
1. In the child process, register SIGTOTEST with handler.
2. call sigwait... |
google | android | 5-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/5-1.c | 1,648 | utf_8 | f5d7aa8725235092531e13670bd4cb74 | /*
* source tree.
This program tests the assertion that if the info parameter is not NULL,
then the selected signal number shall be stored in the si_signo member.
1. Register signal SIGTOTEST with the handler myhandler.
2. Block signal SIGTOTEST, and then raise it causing it to become pending.
3. Call sigwaitinfo... |
google | android | 1-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/1-1.c | 1,814 | utf_8 | 90e2337574eba4cd916e55321a5797ec | /*
* source tree.
* Test that the sigwaitinfo() function shall select the pending signal
from the set set, and atomically clear it from the system's set of
pending signals.
Steps:
1. Register signal SIGTOTEST with the handler myhandler
2. Block SIGTOTEST from the process
3. Raise the signal, ... |
google | android | 8-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/8-1.c | 2,175 | utf_8 | d15c194fc55bdee5900e0179b0c10e18 | /*
* source tree.
This program tests the assertion that if there aren't any more queued signals
for the selected signal, then the pending indication of that signal is
reset.
Steps:
- Register for myhandler to be called when SIGTOTEST is called, and make
sure SA_SIGINFO is set.
- Block signal SIGTOTEST from th... |
google | android | 6-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/6-1.c | 1,631 | utf_8 | 61c0b306c23d1904e1a67930651efda7 | /*
* source tree.
This program tests the assertion that if the info parameter is not NULL,
then the selected signal number shall be stored in the si_signo member.
1. Register signal SIGTOTEST with the handler myhandler.
2. Block signal SIGTOTEST, and then raise it causing it to become pending.
3. Call sigwaitinfo... |
google | android | 2-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/strncpy/2-1.c | 3,088 | utf_8 | 72ae77fd93515e57e19ac72f5e29cd1e | /*
* source tree.
*/
/*
* assertion:
* If the array pointed to by s1 is a string that is shorter than n bytes,
* NUL characters will be appended to the copy in the array pointed to
* by s2, until n bytes in all are written
*
* method:
* -Generate sample string s1 of variable lengths in a loop.
* -Define ... |
google | android | 1-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/strncpy/1-1.c | 2,617 | utf_8 | 5a9d39ae91c79c79f755aa7674e4d69b | /*
* source tree.
*/
/*
* assertion:
*
* The function will copy not more than n bytes (bytes that follow a NUL
* character are not copied) from the array pointed to by s1 to the array
* pointed to by s2. And it will return s2.
* method:
* -Generate sample string s1 of variable lengths in a loop.
* -Use s... |
google | android | 2-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_equal/2-1.c | 7,532 | utf_8 | eeafd1c24cf20d7075dd5565504b8e71 | /*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* This sample test aims to check the following assertion:
*
* The function does not return EINTR
* The steps are:
* -> kill a thread which calls pthread_equal
* -> check that EINTR is never returned
*/
/********************************************... |
google | android | 1-2 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_equal/1-2.c | 1,410 | utf_8 | 786e3c34f828ab01092c10ab69e8f094 | /*
* source tree.
* Test that pthread_equal()
* shall compare the thread ids t1 and t2. The function shall return a non-zero
* value if t1 and t2 are equal, othersise zero shall be returned.
* No errors are defined.
*
* Steps:
* 1. Create 2 threads
* 2. Call pthread_equal and pass to it the two threads.
* ... |
google | android | 1-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_equal/1-1.c | 1,270 | utf_8 | 545e3a6c455f431ddca57902573ae940 | /*
* source tree.
* Test that pthread_equal()
* shall compare the thread ids t1 and t2. The function shall return a non-zero
* value if t1 and t2 are equal, othersise zero shall be returned.
* No errors are defined.
*
* Steps:
* 1. Create a thread
* 2. Call pthread_equal and pass to it the new thread in bot... |
google | android | 1-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_tryrdlock/1-1.c | 5,324 | utf_8 | 3b2db7f36b5d403c0337a3f50b5b6f09 | /*
* source tree.
* Test that pthread_rwlock_tryrdlock(pthread_rwlock_t *rwlock)
*
* The pthread_rwlock_tryrdlock() function shall apply a read lock as in the
* pthread_rwlock_rdlock()
* function, with the exception that the function shall fail if the
* equivalent pthread_rwlock_rdlock()
* call would have block... |
google | android | 2-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/2-1.c | 556 | utf_8 | 19481a40e3b58ee07647cb99f821cb7c | /*
* source tree.
*
* Simply, if sigrelse returns a 0 here, test passes.
*
*/
#include <stdio.h>
#include <signal.h>
#include "posixtest.h"
int main(void)
{
if (sigrelse(SIGABRT) != 0) {
perror("Sigrelse failed");
return PTS_UNRESOLVED;
}
printf("Test PASSED\n");
return PTS_PASS;
} |
google | android | 3-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/3-1.c | 1,205 | utf_8 | 818347c968747d9daf2e42d9fd96fa1d | /*
* source tree.
*
* Testing passing an invalid signals to sigrelse().
* After sighold is called on an invalid signal, sigrelse() should
* return -1 and set errno to EINVAL
*
* The invalid signal passed to sigrelse() depends on the argument
* passed to this program.
*/
#include <stdio.h>
#include <signal.h>
#... |
google | android | 1-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/1-1.c | 1,716 | utf_8 | 2f49dbcd8b77e2efd1f70f1940058c5e | /*
* source tree.
*
* Steps:
* 1. Set up a handler for signal SIGABRT, such that it is called if
* signal is ever raised.
* 2. Call sighold on that SIGABRT.
* 3. Raise a SIGABRT and verify that the signal handler was not called.
* Otherwise, the test exits with unresolved results.
* 4. Call sigrelse on S... |
google | android | 1-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/time/1-1.c | 749 | utf_8 | 18708d8e2f14535995b9ce3bc7563b7c | /*
* source tree.
*
*
*
* This test case shall return PASS on returning the value of time, otherwise
* it fails with -1.
*/
#include <stdio.h>
#include <stdint.h>
#include <time.h>
#include "posixtest.h"
int main(void)
{
time_t current_time;
current_time = time(NULL);
printf("%ju secs since the Epoch\n", (uin... |
google | android | 2-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/2-1.c | 4,332 | utf_8 | b22bc0d464efa0e4f63f8eb5c3f885d0 | /*
* source tree.
* Test that pthread_rwlock_timedwrlock(pthread_rwlock_t *rwlock)
*
* The timeout shall expire when the absolute time specified by abs_timeout passes,
* as measured by the clock on which timeouts are based (that is, when the
* value of that clock equals or exceeds abs_timeout), or if the absolute... |
google | android | 3-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/3-1.c | 8,113 | utf_8 | 36ec9d3d7a25bbc4a41d57b839380408 | /*
* source tree.
* Test that pthread_rwlock_timedwrlock(pthread_rwlock_t *rwlock)
*
* pthread_rwlock_timedwrlock() function shall apply a write lock to the
* read-write lock referenced by rwlock as in the pthread_rwlock_wrlock() function.
* However, if the lock cannot be acquired without waiting for other thread... |
google | android | 5-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/5-1.c | 5,725 | utf_8 | c3e252db9002a3a9fe1b01a924782256 | /*
* source tree.
* Test that pthread_rwlock_timedwrlock(pthread_rwlock_t *rwlock)
*
* Under no circumstances shall the function fail with a timeout if the lock can be
* acquired immediately. The abs_timeout parameter need not be checked if the lock
* can be immediately acquired.
*
* Steps:
* 1. Main thread c... |
google | android | 6-2 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/6-2.c | 5,991 | utf_8 | 260072062d583e5e982aa824b5f52197 | /*
* source tree.
* Test pthread_rwlock_timedwrlock(pthread_rwlock_t * rwlock)
*
* If a signal that causes a signal handler to be executed is delivered to
* a thread blocked on a read-write lock via a call to pthread_rwlock_timedwrlock(),
* upon return from the signal handler the thread shall resume waiting for t... |
google | android | 1-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/1-1.c | 7,606 | utf_8 | caf8a597bea93bdb2727e4b72f5b4b40 | /*
* source tree.
* Test that pthread_rwlock_timedwrlock(pthread_rwlock_t *rwlock)
*
* pthread_rwlock_timedwrlock() function shall apply a write lock to the
* read-write lock referenced by rwlock as in the pthread_rwlock_wrlock() function.
* However, if the lock cannot be acquired without waiting for other thread... |
google | android | 6-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/6-1.c | 5,569 | utf_8 | d1cee25d92f882fffbc06b6cd4ab0c42 | /*
* source tree.
* Test pthread_rwlock_timedwrlock(pthread_rwlock_t * rwlock)
*
* If a signal that causes a signal handler to be executed is delivered to
* a thread blocked on a read-write lock via a call to pthread_rwlock_timedwrlock(),
* upon return from the signal handler the thread shall resume waiting for t... |
google | android | 3-3 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/3-3.c | 5,147 | utf_8 | 929e55ba96c22fdc45a09510901c66e8 | /*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* This sample test aims to check the following assertion:
*
* If pshared is non-zero, any process that can access the semaphore can use it.
* The steps are:
* -> Create a shared memory segment and mmap it.
* -> sem_init a semaphore placed in this segment,... |
google | android | 5-2 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/5-2.c | 853 | utf_8 | 7fc83be89be85bad24757bb881ea9da9 | /*
source tree.
*/
/*
* successful unamed semaphore initialization return zero
* on successful completion.
*/
#include <sys/types.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <semaphore.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "posixtest.h"
#define TEST "5-2"
#define FUNCTION... |
google | android | 7-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/7-1.c | 4,017 | utf_8 | 410978ec295a8742a5dbcbd2dedd82bd | /*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* This sample test aims to check the following assertion:
*
* sem_init returns -1 and sets errno to ENOSPC if the system lacks a resource
* or SEM_NSEMS_MAX has been reached.
* The steps are:
* -> Try and sem_init SEM_NSEMS_MAX semaphores.
* -> Try and s... |
google | android | 3-2 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/3-2.c | 5,015 | utf_8 | 54de9917dc3045edd9ffcdf505d71c7d | /*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* This sample test aims to check the following assertion:
*
* If pshared is non-zero, any process that can access the semaphore can use it.
* The steps are:
* -> Create a shared memory segment and mmap it.
* -> sem_init a semaphore placed in this segment,... |
google | android | 2-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/2-1.c | 1,119 | utf_8 | bd797a6f0edb29f61e0c57e4ca12ed27 | /*
source tree.
*/
/*
* unamed semaphore is used in subsequent of sem_wait.
*/
#include <sys/types.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <semaphore.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "posixtest.h"
#define TEST "2-1"
#define FUNCTION "sem_init"
#define ERROR_PREFIX... |
google | android | 3-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/3-1.c | 1,767 | utf_8 | b6b4b0318cbb1a3846e864bdc1b37f4b | /*
* source tree.
*/
/*
* This test case illustrate the semaphore is shared between processes when
* pshared value is non-zero.
*/
#include <sys/types.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <semaphore.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <pthread.h>
#include "posix... |
google | android | 5-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/5-1.c | 871 | utf_8 | b0a7750194d8b78a835f0ea2c7b323e0 | /*
source tree.
*/
/*
* un-successful unamed semaphore initialization return -1, otherwise zero
* on successful completion.
*/
#include <sys/types.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <semaphore.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "posixtest.h"
#define TEST "5-1"... |
google | android | 1-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/1-1.c | 1,045 | utf_8 | 6ac3eca8540677d0aece6777d49e2de4 | /*
source tree.
*/
/*
The following test case initializes an unnamed semaphore with a value of 1,
and then check the value of the semaphore.
*/
#include <sys/types.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <semaphore.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "posixtest.h"
#de... |
google | android | 2-2 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/2-2.c | 1,116 | utf_8 | 659583b1f7c4bf9d1ef798e9645a063b | /*
source tree.
*/
/*
* unamed semaphore is used in subsequent of sem_post.
*/
#include <sys/types.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <semaphore.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "posixtest.h"
#define TEST "2-1"
#define FUNCTION "sem_init"
#define ERROR_PREFIX... |
google | android | 6-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/6-1.c | 968 | utf_8 | cd1e85c38691071a57a3d2be3e5a17bd | /*
source tree.
*/
/* sem_init shall fail if the valueargument exceeds SEM_VALUE_MAX.
*/
#include <sys/types.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <semaphore.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "posixtest.h"
#include <limits.h>
#define TEST "6-1"
#define FUNCTION "... |
google | android | 7-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/signal/7-1.c | 1,061 | utf_8 | 10d4bfee4bc14f539e692350acfec640 | /*
* source tree.
This program tests the assertion that signal() shall return SIG_ERR
and set errno to a positive value if an invalid signal number was
passed to it.
*/
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include "posixtest.h"
static void myhandler(int signo PTS_ATTRIBUTE_... |
google | android | 2-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/signal/2-1.c | 1,426 | utf_8 | a969b1ba7325bffac0370fb43f56974b | /*
* source tree.
This program tests the assertion that the signal shall be ignored
if the value of the func parameter is SIG_IGN.
How this program tests this assertion is by setting up a handler
"myhandler" for SIGCHLD. Then another call to signal() is made about
SIGCHLD, this time with SIG_IGN as the value of t... |
google | android | 3-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/signal/3-1.c | 1,162 | utf_8 | c15d3457f705162c1c9e55588434e836 | /*
* source tree.
This program tests the assertion that the signal shall be ignored
if the value of the func parameter is SIG_IGN.
How this program tests this assertion is by setting up a handler
"myhandler" for SIGCHLD, and then raising that signal. If the
handler_called variable is anything but 1, then fail, ot... |
google | android | 5-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/signal/5-1.c | 1,483 | utf_8 | 44874326a363683260dd1cc93b89f254 | /*
* source tree.
This program tests the assertion that the signal function shall return
the function name of the last signal handler that was associated with
sig.
How this program tests this assertion is by setting up handlers
SIGUSR1_handler and SIGUSR2_handler for signals SIGUSR1 and SIGUSR2
respectively. A t... |
google | android | 1-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/signal/1-1.c | 1,462 | utf_8 | e29fe51a8bafceae6b2bbf320dc9829a | /*
* source tree.
This program tests the assertion that the default handling of the
signal shall occur if the value of the func parameter is SIG_DFL.
How this program tests this assertion by setting up a handler
"myhandler" for SIGCHLD. Then another call to signal() is made about
SIGCHLD, this time with SIG_DFL a... |
google | android | 6-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/signal/6-1.c | 1,054 | utf_8 | 91461178c9e129ebac62e8954924f394 | /*
* source tree.
This program tests the assertion that signal() shall return SIG_ERR
and set errno to a positive value if an invalid signal number was
passed to it.
*/
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include "posixtest.h"
static void myhandler(int signo PTS_ATTRIBUTE_... |
google | android | 2-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_init/2-1.c | 5,027 | utf_8 | 1c715220e4a756ee394af44502ecf676 | /*
* source tree.
*
* Test pthread_spin_init(pthread_spinlock_t *lock, int pshared)
*
* If the Thread Process-Shared Synchronization option is supported and
* the value of pshared is PTHREAD_PROCESS_SHARED, the implementation shall
* permit the spin lock to be opreated upon by any thread that has access
* to th... |
google | android | 1-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_init/1-1.c | 1,711 | utf_8 | 36689c74428480e3de32e3277e5c7678 | /*
* source tree.
*
* Test pthread_spin_init(pthread_spinlock_t * lock, int pshared)
*
* pthread_spin_init() shall allocate any resources required to use
* the spin lock referenced by 'lock' and initialize the lock to an
* unlocked state.
*
* Steps:
* 1. Initialize a pthread_spinlock_t object 'spinlock' with... |
google | android | 2-2 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_init/2-2.c | 4,973 | utf_8 | e40ccde2daf0457a973751203cab2f70 | /*
* source tree.
*
* Test pthread_spin_init(pthread_spinlock_t *lock, int pshared)
*
* If the Thread Process-Shared Synchronization option is supported
* and the value of pshared is PTHREAD_PROCESS_PRIVATE, or if the option
* is not supported, the spin lock shall only be operated upon by threads created
* ... |
google | android | 4-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_init/4-1.c | 2,431 | utf_8 | 2b60e013ea682b54178b3db6484a4d1c | /*
* source tree.
*
* Test pthread_spin_init(pthread_spinlock_t * lock, int pshared)
*
* These functions may fail if:
* [EBUSY] The implementation has detected an attempt to initialize or destroy a spin
* lock while it is in use (for example, while being used in a pthread_spin_lock()
* call) by another thread.... |
google | android | 3-2 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setprioceiling/3-2.c | 1,662 | utf_8 | e2fcae3981c9f70930acff027135d726 | /*
* source tree.
* Test that pthread_mutexattr_setprioceiling()
*
* It MAY fail if:
*
* [EINVAL] - 'attr' or 'prioceiling' is invalid.
* [EPERM] - The caller doesn't have the privilege to perform the operation.
*
* Steps:
* 1. Initialize a pthread_mutexattr_t object with pthread_mutexattr_init()
* 2. Call... |
google | android | 3-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setprioceiling/3-1.c | 1,604 | utf_8 | db26992b95a60237678a5b8bae33011b | /*
* source tree.
* Test that pthread_mutexattr_setprioceiling()
*
* It MAY fail if:
*
* [EINVAL] - 'attr' or 'prioceiling' is invalid.
* [EPERM] - The caller doesn't have the privilege to perform the operation.
*
* Steps:
* 1. Initialize a pthread_mutexattr_t object with pthread_mutexattr_init()
* 2. Call... |
google | android | 1-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setprioceiling/1-1.c | 1,766 | utf_8 | 4f10d6a5ba8e93acbcb6a5c0ac7e422c | /*
* source tree.
* Test that pthread_mutexattr_setprioceiling()
*
* Sets the priority ceiling attribute of a mutexattr object (which was prev. created
* by the function pthread_mutexattr_init()).
*
* Steps:
* 1. Initialize a pthread_mutexattr_t object with pthread_mutexattr_init()
* 2. Get the min and max b... |
google | android | 2-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_getpshared/2-1.c | 5,845 | utf_8 | 09b163bcdc5b84ed5b8424fe4462bd63 | /*
* source tree.
*
* The idea of this case comes from GNU C library NPTL test tst-barrier2.c.
*
* The process-shared attribute is set to PTHREAD_PROCESS_SHARED to permit
* a barrier to be operated upon by any thread that has access to the memory
* where the barrier is allocated. If the process-shared attribute
... |
google | android | 1-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_getpshared/1-1.c | 1,429 | utf_8 | 2564f583f2bd62715000d5a02be81de0 | /*
* source tree.
*
* pthread_barrierattr_getpshared()
*
* The pthread_barrierattr_getpshared() function shall obtain the value of
* the process-shared attribute from the attributes object referenced by attr.
*
*/
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h... |
google | android | 1-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/asctime/1-1.c | 1,688 | utf_8 | 68af77f80365a8c9fdf6297398ba1f9a | /*
* source tree.
The asctime() function shall convert the broken-down time in the structure pointed to by timeptr into a string in the form: Sun Sep 16 01:03:52 1973\n\0
*/
#define WEEKDAY 0
#define MONTH 8
#define MONTHDAY 16
#define HOUR 1
#define MINUTE 3
#define SECOND 52
#define YEAR 73
#include <string.h>
#inc... |
google | android | 3-3 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/3-3.c | 1,947 | utf_8 | 7bd15b01e3e788c969ec5d1901cac891 | /*
* source tree.
* Test pthread_mutexattr_settype()
*
PTHREAD_MUTEX_ERRORCHECK
Provides errorchecking. A thread attempting to relock this mutex without unlocking it
first will return with an error. A thread attempting to unlock a mutex which another
thread has locked will return with an error. A thread a... |
google | android | 7-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/7-1.c | 1,433 | utf_8 | c96a7d9710b4abd19b9693e5d966bdd2 | /*
* source tree.
* Test pthread_mutexattr_settype()
*
* It shall fail if:
* [EINVAL] - The value 'type' is invalid.
* It may fail if:
* [EINVAL] - The value specified by 'attr' is invalid.
*
* Steps:
* 1. Initialize a pthread_mutexattr_t object.
* 2. Pass to pthread_mutexattr_settype an invalid type. It ... |
google | android | 3-2 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/3-2.c | 2,836 | utf_8 | a412096f68233eb7aa281df7ccdb86eb | /*
* source tree.
* Test pthread_mutexattr_settype()
*
* PTHREAD_MUTEX_ERRORCHECK
* Provides errorchecking. A thread attempting to relock this mutex without unlocking it
* first will return with an error. A thread attempting to unlock a mutex which another
* thread has locked will return with an error. A thre... |
google | android | 2-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/2-1.c | 2,321 | utf_8 | 1c170b60e32d59ea14277bd925ce615c | /*
* source tree.
* Test pthread_mutexattr_settype()
*
* PTHREAD_MUTEX_NORMAL
* This type of mutex doesn't detect deadlock. So a thread attempting to relock this mutex
* without unlocking it first will not return an error. Attempting to unlock a mutex locked
* by a different thread results in undefined beh... |
google | android | 3-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/3-1.c | 2,292 | utf_8 | 4a16d35168806a760cf28a0abaa6980b | /*
* source tree.
* Test pthread_mutexattr_settype()
*
* PTHREAD_MUTEX_ERRORCHECK
* Provides errorchecking. A thread attempting to relock this mutex without unlocking it
* first will return with an error. A thread attempting to unlock a mutex which another
* thread has locked will return with an error. A thre... |
google | android | 1-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/1-1.c | 2,517 | utf_8 | d9f690482fab08888c33538c5c59fe30 | /*
* source tree.
* Test pthread_mutexattr_settype()
* int pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type);
* Sets the mutex 'type' attribute. This attribute is set in the 'type' parameter to
* these functions. The default value is PTHREAD_MUTEX_DEFAULT.
*/
#include <pthread.h>
#include <stdio.h>... |
google | android | 3-4 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/3-4.c | 2,409 | utf_8 | 81aee3f3acdad95c66d6d3abf869a2fd | /*
* source tree.
* Test pthread_mutexattr_settype()
*
PTHREAD_MUTEX_ERRORCHECK
Provides errorchecking. A thread attempting to relock this mutex without unlocking it
first will return with an error. A thread attempting to unlock a mutex which another
thread has locked will return with an error. A thread a... |
google | android | 2-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigpending/2-1.c | 1,628 | utf_8 | e0a28aa1e9fe33ae25f554c35e9bfe0e | /*
* source tree.
* Test that the sigpending() function returns 0 on successful completion.
* 1) Block one signal from delivery.
* 2) Raise that signal.
* 3) Call sigpending and verify it returns 0.
* 4) Verify the signal raised is shown.
*/
#include <signal.h>
#include <stdio.h>
#include "posixtest.h"
... |
google | android | 1-2 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigpending/1-2.c | 2,937 | utf_8 | 8561f101fbca1dfa413326a3565b55aa | /*
* source tree.
* Test that the sigpending() function stores the set of signals that
* are blocked from delivery to a signal handler function. Steps are:
* 1) Block three signals from delivery to a signal handler.
* 2) Raise the signal to get into that signal handler.
* From the signal handler:
* 3)... |
google | android | 1-3 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigpending/1-3.c | 3,479 | utf_8 | 1c0b49d759811a7be1c11ee65241c1ce | /*
* source tree.
* Test that the sigpending() function stores the set of signals that
* are blocked from delivery when there are signals blocked both
* in the main function and in the signal handler.
* 1) Block two signals from delivery to main process.
* 2) Block three signals from delivery to a signal h... |
google | android | 1-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigpending/1-1.c | 2,031 | utf_8 | 3abb3614b8207c23aff8ad35790be826 | /*
* source tree.
* Test that the sigpending() function stores the set of signals that
* are blocked from delivery. Steps are:
* 1) Block three signals from delivery.
* 2) Raise two of those signals.
* 3) Verify that the two signals raised are shown via sigpending.
* 4) Verify the one signal not raise... |
google | android | 5-3 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/5-3.c | 2,656 | utf_8 | 68e1ffbe3c24fb7d26eba60a24c5b0d3 | /*
* source tree.
* Test that pthread_mutex_timedlock()
*
* It shall fail if:
*
* [ETIMEDOUT] - The timeout expried and the mutex could not be locked.
*
* Steps:
*
* 1. In main(), lock the mutex then create a thread.
* 2. Inside the thread, call pthread_mutex_timedlock. It should block and return
* ETIM... |
google | android | 5-2 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/5-2.c | 2,970 | utf_8 | 0a31dab806b639c0e256da273671a6c5 | /*
* source tree.
* Test that pthread_mutex_timedlock()
*
* It SHALL fail if:
*
* [EINVAL] - The process or thread would have blocked, and the abs_timeout parameter
* specified in nano-seconds field value is less than 0 or greater than or equal
* to 1,000 million.
*
* Steps:
*
* 1. Create a threa... |
google | android | 2-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/2-1.c | 4,520 | utf_8 | a5c8d81c008a5f315faf1dc0b65a4861 | /*
* source tree.
* Test that pthread_mutex_timedlock()
* locks the mutex object referenced by 'mutex'. If the mutex is
* already locked, the calling thread shall block until the mutex becomes
* available. The wait will end when the specified timeout time has expired.
* The timeout expires when the absolute tim... |
google | android | 5-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/5-1.c | 2,969 | utf_8 | f71986b0fe2f1fd91afa481452db912e | /*
* source tree.
* Test that pthread_mutex_timedlock()
*
* It SHALL fail if:
*
* [EINVAL] - The process or thread would have blocked, and the abs_timeout parameter
* specified in nano-seconds field value is less than 0 or greater than or equal
* to 1,000 million.
*
* Steps:
*
* 1. Create a threa... |
google | android | 1-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/1-1.c | 3,989 | utf_8 | 3e1012f98c80b5fc1049c05e51e38a26 | /*
* source tree.
* Test that pthread_mutex_timedlock()
* locks the mutex object referenced by 'mutex'. If the mutex is
* already locked, the calling thread shall block until the mutex becomes
* available. The wait will end when the specified timeout time has expired.
* The timeout expires when the absolute tim... |
google | android | 4-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/4-1.c | 2,469 | utf_8 | fb9104785018254f282006f975812b1c | /*
* source tree.
* Test that pthread_mutex_timedlock()
*
* Upon success, it returns 0.
*
* Steps:
*
* 1. Create a thread, and call pthread_mutex_timedlock inside of it. It should not block
* and should return 0 since it will be the only one owning the mutex.
* 2. Save the return value of pthread_mutex_ti... |
google | android | 5-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigignore/5-1.c | 1,090 | utf_8 | a10857762754f05831a984602ea231ba | /*
* source tree.
*
* Testing passing an invalid signals to sighold().
* After sighold is called on an invalid signal, sigignore() should
* return -1 and set errno to EINVAL
*/
#include <stdio.h>
#include <signal.h>
#include <errno.h>
#include <stdint.h>
#include "posixtest.h"
static const int sigs[] = {-1, -1000... |
google | android | 6-2 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigignore/6-2.c | 889 | utf_8 | 9b26d961108975e8ac6788e7714d5ca0 | /*
* source tree.
Testing trying to ignore a signal that cannot be ignored.
Line 1264 in Issue 6 of the Posix System Interfaces document says that
the system shall not allow the signals SIGKILL or SIGSTOP
to be ignored.
*/
#include <stdio.h>
#include <signal.h>
#include <errno.h>
#include <stdint.h>
#incl... |
google | android | 1-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigignore/1-1.c | 1,236 | utf_8 | fe9b4ba17cce964d41ca703d635c2fc9 | /*
* source tree.
Steps:
1. Set up a handler for signal SIGABRT, such that it is called if
signal is ever raised.
2. Call sigignore on SIGABRT.
3. Raise a SIGABRT and verify that the signal handler was not called.
*/
#include <signal.h>
#include <stdio.h>
#include "posixtest.h"
static int handler_called = 0;
stati... |
google | android | 4-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigignore/4-1.c | 556 | utf_8 | 4b7fcda29b5c815ed3523ee1697dc86d | /*
* source tree.
*
* Simply, if sigignore returns a 0 here, test passes.
*/
#include <stdio.h>
#include <signal.h>
#include "posixtest.h"
int main(void)
{
if (sigignore(SIGABRT) != 0) {
perror("sigignore failed");
return PTS_UNRESOLVED;
}
printf("Test PASSED\n");
return PTS_PASS;
} |
google | android | 6-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigignore/6-1.c | 889 | utf_8 | 53a81bee6b203aba3dd5f6a3ec33f2be | /*
* source tree.
Testing trying to ignore a signal that cannot be ignored.
Line 1264 in Issue 6 of the Posix System Interfaces document says that
the system shall not allow the signals SIGKILL or SIGSTOP
to be ignored.
*/
#include <stdio.h>
#include <signal.h>
#include <errno.h>
#include <stdint.h>
#incl... |
google | android | 32-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/32-1.c | 2,207 | utf_8 | 5f9fb9c9d74b524850e2211de05e4040 | /*
*
* Test that the shm_open() function sets errno = EACCES if the shared memory
* object exists and the permissions specified by oflag are denied
*
* Create a shared memory object with no read or write permission and try to
* open it.
*/
#include <stdio.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <... |
google | android | 21-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/21-1.c | 1,518 | utf_8 | 85deaf5a4f1eee4c417ab2fff77a509e | /*
*
* Test that the shared memory object has a size of zero when created.
*
* The test use fstat to get the size of shared memory object.
*/
#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include "posixtest.h"
#define SHM_NAME "posixtest_2... |
google | android | 28-3 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/28-3.c | 2,542 | utf_8 | 30dc0b4a8f518b6fe1750f19028ec8b0 | /*
*
* Test that the state of the shared memory object, including all data
* associated with the shared memory object, persists until all open references
* are gone even if the shared memory object is unlinked and there
* is no mapping reference anymore.
*
* Steps:
* 1. Create a shared memory object, map it an... |
google | android | 20-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/20-1.c | 1,599 | utf_8 | f82e98fd5410f84738d2e0a14ca79527 | /*
*
* Test that shm_open does not open the shared memory object for writing when
* calling shm_open with O_RDONLY even if the mode set write permission.
*
* The test use ftruncate to check the object is not open for writing.
*/
#include <stdio.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <unistd.h>
#i... |
google | android | 22-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/22-1.c | 1,257 | utf_8 | a8171d41fc7245932f13f045593fff25 | /*
*
* Test that shm_open() fails if the shared memory object exist and O_EXCL and
* O_CREAT are set.
*/
#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include "posixtest.h"
#define SHM_NAME "posixtest_22-1"
int main(void)
{
int fd;
/* Cre... |
google | android | 37-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/37-1.c | 1,582 | utf_8 | da5d7e18fd1c95374fe59632346f0406 | /*
* Test that the shm_open() function sets errno = EINVAL if the shm_open()
* operation is not supported for the given name.
*
* The supported names are implementation-defined, so the test is done for
* several different names. The test pass for a given name if shm_open make no
* error or set errno to EINVAL.
*... |
google | android | 14-2 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/14-2.c | 2,006 | utf_8 | 514f21c2bed15b993e456cad080f1b8d | /*
*
* Test that the file is open for read acces when the applications specify
* the value of O_RDWR.
*
* Step:
* 1. Create a file a shared memory object using shm_open().
* 2. Write in the file referenced by the file descriptor return by
* shm_open().
* 3. Reopen the file with shm_open() and O_RDWR set... |
google | android | 11-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/11-1.c | 1,219 | utf_8 | 18fd4439b5965521100317e54e1937e3 | /*
*
* Test that the FD_CLOEXEC file descriptor flag associated with the new file
* descriptor is set
*
* The test use fstat to check the flag.
*/
#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include "posixtest.h"
#define SHM_NAME "posixtest_11-1"
int main(void)
{
int fd, fl... |
google | android | 16-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/16-1.c | 1,648 | utf_8 | d18560e2e04688b07123e967605eada4 | /*
*
* Test that the user ID of the shared memory object is set to the effective
* user ID of the process when the shared memory object does not exists and the
* O_CREAT flags is set.
*
* The test use fstat to check the flag.
*/
#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#i... |
google | android | 17-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/17-1.c | 1,649 | utf_8 | 3d0a12a5476dcd16fced3bdac5b826b5 | /*
*
* Test that the goup ID of the shared memory object is set to the effective
* group ID of the process when the shared memory object does not exists and
* the O_CREAT flags is set.
*
* The test use fstat to check the flag.
*/
#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#... |
google | android | 23-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/23-1.c | 3,674 | utf_8 | ea9276a64e268e1934c906e903500ddf | /*
*
* Test that the check for the existence of the shared memory object and the
* creation of the object if it does not exist is atomic with respect to other
* processes executing shm_open() naming the same shared memory object with
* O_EXCL and O_CREAT set.
*
* This test launch NPROCESS processes which all try... |
google | android | 28-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/28-1.c | 2,728 | utf_8 | f42160176edcab8e200c27b03439c91d | /*
*
* Test that the state of the shared memory object, including all data
* associated with the shared memory object, persists until the shared memory
* object is unlinked even if all other references are gone.
*
* Steps:
* 1. Create a shared memory object, map it and write a string in it.
* 2. Unmap the mem... |
google | android | 26-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/26-1.c | 1,804 | utf_8 | 5774cab64293037791c663af39e1a5c9 | /*
*
* Test that the mode is unchanged when O_TRUNC is set, the shared memory
* object exists and it is successfully opened O_RDWR.
*
* Steps:
* 1. Create a shared memory object.
* 2. Call shm_open with O_TRUNC and O_RDWR set and with differents permission
* mode.
* 3. Check that the mode is unchanged.... |
google | android | 39-1 | .c | platform/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/39-1.c | 1,540 | utf_8 | 3e6d3fc2dae88eeed2603c4873c394ff | /*
*
* Test that the shm_open() function sets errno = ENAMETOOLONG if the length
* of a pathname component is longer than {NAME_MAX} (not including the
* terminating null).
*/
#include <stdio.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
#include <stdlib.h... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.