代码搜索结果
找到约 12,494 项符合
PID 的代码
lock.c
#include "calld.h"
typedef struct {
char *line; /* points to malloc()ed area */
/* we lock by line (device name) */
pid_t pid; /* but unlock by process ID */
/* pid of 0 means available
fig8.13
#include "apue.h"
static void charatatime(char *);
int
main(void)
{
pid_t pid;
TELL_WAIT();
if ((pid = fork()) < 0) {
err_sys("fork error");
} else if (pid == 0) {
WAIT_PARENT(); /* paren
exec1.c
#include "apue.h"
#include
char *env_init[] = { "USER=unknown", "PATH=/tmp", NULL };
int
main(void)
{
pid_t pid;
if ((pid = fork()) < 0) {
err_sys("fork error");
} else if (pid ==
shell2.c
#include "apue.h"
#include
static void sig_int(int); /* our signal-catching function */
int
main(void)
{
char buf[MAXLINE]; /* from apue.h */
pid_t pid;
int status;
if (signal(SI
fork1.c
#include "apue.h"
int glob = 6; /* external variable in initialized data */
char buf[] = "a write to stdout\n";
int
main(void)
{
int var; /* automatic variable on the stack */
pid_t pid;
var
exec2.c
#include "apue.h"
#include
int
main(void)
{
pid_t pid;
if ((pid = fork()) < 0) {
err_sys("fork error");
} else if (pid == 0) { /* child */
if (execl("/home/sar/bin/testinterp",
zombie.c
#include "apue.h"
#ifdef SOLARIS
#define PSCMD "ps -a -o pid,ppid,s,tty,comm"
#else
#define PSCMD "ps -o pid,ppid,state,tty,command"
#endif
int
main(void)
{
pid_t pid;
if ((pid = fork()) < 0)
e
wait1.c
#include "apue.h"
#include
int
main(void)
{
pid_t pid;
int status;
if ((pid = fork()) < 0)
err_sys("fork error");
else if (pid == 0) /* child */
exit(7);
if (wait(&status)
vfork3.c
#include "apue.h"
static void f1(void), f2(void);
int
main(void)
{
f1();
f2();
_exit(0);
}
static void
f1(void)
{
pid_t pid;
if ((pid = vfork()) < 0)
err_sys("vfork error");
/* child and p
tellwait2.c
#include "apue.h"
static void charatatime(char *);
int
main(void)
{
pid_t pid;
TELL_WAIT();
if ((pid = fork()) < 0) {
err_sys("fork error");
} else if (pid == 0) {
WAIT_PARENT(); /* paren