repo.or.cz
/
AROS.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Testing a request for BOS descriptor. Device enumeration needs to be quite different...
[AROS.git]
/
test
/
clib
/
execl2_vfork.c
blob
351fb70d2cd1f70eb00b78f17aef9d90e0db604d
1
#include <proto/dos.h>
2
3
#include <stdio.h>
4
#include <stdlib.h>
5
#include <unistd.h>
6
#include <fcntl.h>
7
8
#include
"test.h"
9
10
int
main
(
void
)
11
{
12
int
fd
;
13
FILE
*
f
;
14
15
fd
=
open
(
"execl2_out"
,
O_RDWR
|
O_CREAT
,
00700
);
16
TEST
(
fd
!= -
1
);
17
18
f
=
fdopen
(
fd
,
"w"
);
19
TEST
(
f
!=
NULL
);
20
21
fputs
(
"OK
\n
"
,
f
);
22
fflush
(
f
);
23
24
if
(
vfork
() ==
0
)
25
{
26
char
arg
[
10
];
27
sprintf
(
arg
,
"%d"
,
fd
);
28
execl
(
"execl2_slave"
,
"execl2_slave"
,
arg
,
NULL
);
29
TEST
(
0
);
/* Should not be reached */
30
exit
(
20
);
31
}
32
33
Delay
(
50
);
34
35
return
0
;
36
}
37
38
void
cleanup
(
void
)
39
{
40
/* NOP */
41
return
;
42
}