代码搜索结果
找到约 12,494 项符合
PID 的代码
init.c
// init: The initial user-level program
#include "types.h"
#include "stat.h"
#include "user.h"
#include "fcntl.h"
char *sh_args[] = { "sh", 0 };
int
main(void)
{
int pid, wpid;
if(open("consol
sysproc.c
#include "types.h"
#include "defs.h"
#include "param.h"
#include "mmu.h"
#include "proc.h"
int
sys_fork(void)
{
int pid;
struct proc *np;
if((np = copyproc(cp)) == 0)
return -1;
pid = np
daemonize.c
#include "apue.h"
#include
#include
#ifdef BSD
#include
#endif
#include
void
daemonize(const char *cmd)
{
int i, fd0, fd1, fd2;
pid_t pid;
struct
threadid.c
#include "apue.h"
#include
pthread_t ntid;
void
printids(const char *s)
{
pid_t pid;
pthread_t tid;
pid = getpid();
tid = pthread_self();
printf("%s pid %u tid %u (0x%x)\n", s, (u
request.c
#include "calld.h"
int /* return 0 if OK, -1 on error */
request(Client *cliptr)
{
pid_t pid;
/*
* Position where this client left off last (or rewind).
*/
errmsg[0] = 0;
sys_posn(clip
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