Subversion Repositories Kolibri OS

Rev

Rev 4872 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4349 Serge 1
/*
2
FUNCTION
3
<>---execute command string
4
 
5
INDEX
6
	system
7
INDEX
8
	_system_r
9
 
10
ANSI_SYNOPSIS
11
	#include 
12
	int system(char *<[s]>);
13
 
14
	int _system_r(void *<[reent]>, char *<[s]>);
15
 
16
TRAD_SYNOPSIS
17
	#include 
18
	int system(<[s]>)
19
	char *<[s]>;
20
 
21
	int _system_r(<[reent]>, <[s]>)
22
	char *<[reent]>;
23
	char *<[s]>;
24
 
25
DESCRIPTION
26
 
27
Use <> to pass a command string <<*<[s]>>> to <> on
28
your system, and wait for it to finish executing.
29
 
30
Use ``<>'' to test whether your system has <>
31
available.
32
 
33
The alternate function <<_system_r>> is a reentrant version.  The
34
extra argument <[reent]> is a pointer to a reentrancy structure.
35
 
36
RETURNS
37
<> returns a non-zero value if <> is available, and
38
<<0>> if it is not.
39
 
40
With a command argument, the result of <> is the exit status
41
returned by <>.
42
 
43
PORTABILITY
44
ANSI C requires <>, but leaves the nature and effects of a
45
command processor undefined.  ANSI C does, however, specify that
46
<> return zero or nonzero to report on the existence of
47
a command processor.
48
 
49
POSIX.2 requires <>, and requires that it invoke a <>.
50
Where <> is found is left unspecified.
51
 
52
Supporting OS subroutines required: <<_exit>>, <<_execve>>, <<_fork_r>>,
53
<<_wait_r>>.
54
*/
55
 
56
#include <_ansi.h>
57
#include 
58
#include 
59
#include 
60
#include 
61
#include <_syslist.h>
62
#include 
63
 
64
 
65
int
66
_DEFUN(_system_r, (ptr, s),
67
     struct _reent *ptr _AND
68
     _CONST char *s)
69
{
70
  if (s == NULL)
71
    return 0;
72
  errno = ENOSYS;
73
  return -1;
74
}
75
 
76
#ifndef _REENT_ONLY
77
 
78
int
79
_DEFUN(system, (s),
80
     _CONST char *s)
81
{
82
  return _system_r (_REENT, s);
83
}
84
 
85
#endif