Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
criu
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhul
criu
Commits
7678f440
Commit
7678f440
authored
Sep 29, 2017
by
Andrei Vagin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test/zdtm: a few fixes to compile tests on Alpine
Signed-off-by:
Andrei Vagin
<
avagin@virtuozzo.com
>
parent
0a303160
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
41 additions
and
9 deletions
+41
-9
file_locks01.c
test/zdtm/static/file_locks01.c
+8
-0
ghost_holes00.c
test/zdtm/static/ghost_holes00.c
+5
-0
ipc_namespace.c
test/zdtm/static/ipc_namespace.c
+3
-3
netns-dev.c
test/zdtm/static/netns-dev.c
+1
-0
poll.c
test/zdtm/static/poll.c
+1
-1
pthread01.c
test/zdtm/static/pthread01.c
+1
-1
sigpending.c
test/zdtm/static/sigpending.c
+22
-4
No files found.
test/zdtm/static/file_locks01.c
View file @
7678f440
...
...
@@ -10,6 +10,14 @@
#include "zdtmtst.h"
#include "fs.h"
#ifndef LOCK_MAND
#define LOCK_MAND 32
#endif
#ifndef LOCK_READ
#define LOCK_READ 64
#endif
const
char
*
test_doc
=
"Check that flock locks are restored"
;
const
char
*
test_author
=
"Qiang Huang <h.huangqiang@huawei.com>"
;
...
...
test/zdtm/static/ghost_holes00.c
View file @
7678f440
...
...
@@ -19,6 +19,11 @@ TEST_OPTION(filename, string, "file name", 1);
#define BUFSIZE 4096
static
unsigned
char
buf4k
[
BUFSIZE
];
#ifndef SEEK_DATA
#define SEEK_DATA 3
#define SEEK_HOLE 4
#endif
#ifdef HEAD_HOLE
#define HH 1
#else
...
...
test/zdtm/static/ipc_namespace.c
View file @
7678f440
...
...
@@ -12,9 +12,9 @@
#define CLONE_NEWIPC 0x08000000
extern
int
msgctl
(
int
__msqid
,
int
__cmd
,
struct
msqid_ds
*
__buf
)
__THROW
;
extern
int
semctl
(
int
__semid
,
int
__semnum
,
int
__cmd
,
...)
__THROW
;
extern
int
shmctl
(
int
__shmid
,
int
__cmd
,
struct
shmid_ds
*
__buf
)
__THROW
;
extern
int
msgctl
(
int
__msqid
,
int
__cmd
,
struct
msqid_ds
*
__buf
);
extern
int
semctl
(
int
__semid
,
int
__semnum
,
int
__cmd
,
...);
extern
int
shmctl
(
int
__shmid
,
int
__cmd
,
struct
shmid_ds
*
__buf
);
struct
ipc_ids
{
int
in_use
;
/* TODO: Check for 0 */
...
...
test/zdtm/static/netns-dev.c
View file @
7678f440
#include <unistd.h>
#include <stdlib.h>
#include <dirent.h>
#include <linux/limits.h>
#include "zdtmtst.h"
...
...
test/zdtm/static/poll.c
View file @
7678f440
...
...
@@ -9,7 +9,7 @@
#include <time.h>
#include <sys/stat.h>
#include <
sys/
poll.h>
#include <poll.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/wait.h>
...
...
test/zdtm/static/pthread01.c
View file @
7678f440
...
...
@@ -33,7 +33,7 @@ static char *decode_signal(const sigset_t *s, char *buf)
#define COLLECT(sig) \
do { \
if (
(long)s->__val[0] & (long)sigmask(sig))
\
if (
sigismember(s, sig))
\
strcat(buf, #sig " "); \
} while (0)
...
...
test/zdtm/static/sigpending.c
View file @
7678f440
...
...
@@ -28,6 +28,24 @@ static int thread_nr;
# define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
#endif
/* cr_siginfo is declared to get an offset of _sifields */
union
cr_siginfo
{
struct
{
int
si_signo
;
int
si_errno
;
int
si_code
;
union
{
int
_pad
[
10
];
/* ... */
}
_sifields
;
}
_info
;
siginfo_t
info
;
};
typedef
union
cr_siginfo
cr_siginfo_t
;
#define siginf_body(s) (&((cr_siginfo_t *)(s))->_info._sifields)
#ifdef __i386__
/*
* On x86_32 kernel puts only relevant union member when signal arrives,
...
...
@@ -44,9 +62,9 @@ static int thread_nr;
*/
# define _si_fields_sz 12
#else
# define _si_fields_sz (sizeof(siginfo_t) - offsetof(
siginfo_t,
_sifields))
# define _si_fields_sz (sizeof(siginfo_t) - offsetof(
cr_siginfo_t, _info.
_sifields))
#endif
#define siginfo_filled (offsetof(
siginfo_t,
_sifields) + _si_fields_sz)
#define siginfo_filled (offsetof(
cr_siginfo_t, _info.
_sifields) + _si_fields_sz)
static
pthread_mutex_t
exit_lock
;
static
pthread_mutex_t
init_lock
;
...
...
@@ -90,7 +108,7 @@ static void sig_handler(int signal, siginfo_t *info, void *data)
}
crc
=
~
0
;
if
(
datachk
((
uint8_t
*
)
&
info
->
_sifields
,
_si_fields_sz
,
&
crc
))
{
if
(
datachk
((
uint8_t
*
)
siginf_body
(
info
)
,
_si_fields_sz
,
&
crc
))
{
fail
(
"CRC mismatch
\n
"
);
return
;
}
...
...
@@ -172,7 +190,7 @@ int send_siginfo(int signo, pid_t pid, pid_t tid, int group, siginfo_t *info)
info
->
si_code
=
si_code
;
si_code
--
;
info
->
si_signo
=
signo
;
datagen
((
uint8_t
*
)
&
info
->
_sifields
,
_si_fields_sz
,
&
crc
);
datagen
((
uint8_t
*
)
siginf_body
(
info
)
,
_si_fields_sz
,
&
crc
);
sent_sigs
++
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment