您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ sys_getpid函数代码示例

51自学网 2021-06-03 08:37:09
  C++
这篇教程C++ sys_getpid函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中sys_getpid函数的典型用法代码示例。如果您正苦于以下问题:C++ sys_getpid函数的具体用法?C++ sys_getpid怎么用?C++ sys_getpid使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了sys_getpid函数的24个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: restore_signals

static int restore_signals(siginfo_t *ptr, int nr, bool group){	int ret, i;	k_rtsigset_t to_block;	ksigfillset(&to_block);	ret = sys_sigprocmask(SIG_SETMASK, &to_block, NULL, sizeof(k_rtsigset_t));	if (ret) {		pr_err("Unable to block signals %d", ret);		return -1;	}	for (i = 0; i < nr; i++) {		siginfo_t *info = ptr + i;		pr_info("Restore signal %d group %d/n", info->si_signo, group);		if (group)			ret = sys_rt_sigqueueinfo(sys_getpid(), info->si_signo, info);		else			ret = sys_rt_tgsigqueueinfo(sys_getpid(),						sys_gettid(), info->si_signo, info);		if (ret) {			pr_err("Unable to send siginfo %d %x with code %d/n",					info->si_signo, info->si_code, ret);			return -1;;		}	}	return 0;}
开发者ID:kunalkushwaha,项目名称:crtools,代码行数:30,


示例2: sigchld_handler

static void sigchld_handler(int signal, siginfo_t *siginfo, void *data){	char *r;	if (futex_get(&task_entries->start) == CR_STATE_RESTORE_SIGCHLD) {		pr_debug("%ld: Collect a zombie with (pid %d, %d)/n",			sys_getpid(), siginfo->si_pid, siginfo->si_pid);		futex_dec_and_wake(&task_entries->nr_in_progress);		futex_dec_and_wake(&zombies_inprogress);		task_entries->nr_threads--;		task_entries->nr_tasks--;		mutex_unlock(&task_entries->zombie_lock);		return;	}	if (siginfo->si_code & CLD_EXITED)		r = " exited, status=";	else if (siginfo->si_code & CLD_KILLED)		r = " killed by signal ";	else		r = "disappeared with ";	pr_info("Task %d %s %d/n", siginfo->si_pid, r, siginfo->si_status);	futex_abort_and_wake(&task_entries->nr_in_progress);	/* sa_restorer may be unmaped, so we can't go back to userspace*/	sys_kill(sys_getpid(), SIGSTOP);	sys_exit_group(1);}
开发者ID:kunalkushwaha,项目名称:crtools,代码行数:29,


示例3: process_main

void process_main(void) {    while (1) {        if (rand() % ALLOC_SLOWDOWN == 0) {            if (sys_fork() == 0) {                break;            }        } else {            sys_yield();        }    }    pid_t p = sys_getpid();    srand(p);    // The heap starts on the page right after the 'end' symbol,    // whose address is the first address not allocated to process code    // or data.    heap_top = ROUNDUP((uint8_t*) end, PAGESIZE);    // The bottom of the stack is the first address on the current    // stack page (this process never needs more than one stack page).    stack_bottom = ROUNDDOWN((uint8_t*) read_rsp() - 1, PAGESIZE);    // Allocate heap pages until (1) hit the stack (out of address space)    // or (2) allocation fails (out of physical memory).    while (1) {        int x = rand() % (8 * ALLOC_SLOWDOWN);        if (x < 8 * p) {            if (heap_top == stack_bottom || sys_page_alloc(heap_top) < 0) {                break;            }            *heap_top = p;      /* check we have write access to new page */            heap_top += PAGESIZE;            if (console[CPOS(24, 0)]) {                /* clear "Out of physical memory" msg */                console_printf(CPOS(24, 0), 0, "/n");            }        } else if (x == 8 * p) {            if (sys_fork() == 0) {                p = sys_getpid();            }        } else if (x == 8 * p + 1) {            sys_exit();        } else {            sys_yield();        }    }    // After running out of memory    while (1) {        if (rand() % (2 * ALLOC_SLOWDOWN) == 0) {            sys_exit();        } else {            sys_yield();        }    }}
开发者ID:noorzaman,项目名称:CS61,代码行数:57,


示例4: xmutex_unlock

voidxmutex_unlock(struct xmutex * lock, sigset_t sigset){	TRACE(MUTEX, "thread %d:%d is unlocking %p/n",			sys_getpid(), sys_gettid(), lock);	/* atomic_dec(&lock->val) != 1 */	if (!atomic_dec_and_test(&lock->val)) {		atomic_set(&lock->val, 0);		futex_wake(&lock->val, 1);	}	restore_signals(sigset);	TRACE(MUTEX, "thread %d:%d unlocked %p/n",			sys_getpid(), sys_gettid(), lock);}
开发者ID:forhappy,项目名称:libloader,代码行数:14,


示例5: sys__exit

void sys__exit(int exitcode){	pid_t pid = sys_getpid();    struct processhandler *ph;    ph = pidmanager_get(pidmgr, pid);    //kprintf("HERE1/n");    assert(ph != NULL);    //kprintf("HERE2/n");    lock_acquire(ph->ph_exitlock);	//kprintf("exiting here on this pid %d with exitcode %d/n", pid, exitcode);    ph->ph_status = PH_EXITED;    ph->ph_exitcode = exitcode;    // wakes up all threads sleeping on the exit lock    cv_signal(ph->ph_exitcv, ph->ph_exitlock);    lock_release(ph->ph_exitlock);    // exit the thread	//int s = splhigh();	//kprintf ("exiting: %d/n", curthread->t_pid);	//splx(s);    thread_exit();    return;}
开发者ID:dkim1000,项目名称:areallylongdirectorynamethatwehopethatpeoplewillnotfind,代码行数:30,


示例6: tcpip_init_done

static void tcpip_init_done(void* arg) {    current_task->name = "[tcpipd]";    current_task->description = "TCP/IP Stack daemon";    current_task->priority = TASK_PRIO_MIN;#if DEBUG    kprintf(LOG "[%d] tcpip: initialized in %d MS/n", sys_getpid(), (uintptr_t) (timer_getms() - (uintptr_t) arg));#else    (void) arg;#endif    struct netif* lo = netif_find("lo0");    if(likely(lo)) {        netif_set_up(lo);        netif_set_default(lo);    } else        kprintf(WARN "netif: Loopback interface not found/n");    ip_addr_t dns[2];    IP4_ADDR(&dns[0], 8, 8, 8, 8);    IP4_ADDR(&dns[1], 8, 8, 4, 4);    dns_setserver(0, &dns[0]);    dns_setserver(1, &dns[1]);}
开发者ID:WareX97,项目名称:aPlus,代码行数:31,


示例7: msg_inject_fault

static void msg_inject_fault(int msg_type, struct process_id src,			    void *buf, size_t len, void *private_data){	int sig;	if (len != sizeof(int)) {				DEBUG(0, ("Process %llu sent bogus signal injection request/n",			(unsigned long long)src.pid));		return;	}	sig = *(int *)buf;	if (sig == -1) {		exit_server("internal error injected");		return;	}#if HAVE_STRSIGNAL	DEBUG(0, ("Process %llu requested injection of signal %d (%s)/n",		    (unsigned long long)src.pid, sig, strsignal(sig)));#else	DEBUG(0, ("Process %llu requested injection of signal %d/n",		    (unsigned long long)src.pid, sig));#endif	kill(sys_getpid(), sig);}
开发者ID:chazikai24,项目名称:asuswrt,代码行数:28,


示例8: fault_report

/*******************************************************************report a fault********************************************************************/static void fault_report(int sig){	static int counter;	if (counter) _exit(1);	counter++;	DEBUGSEP(0);	DEBUG(0,("INTERNAL ERROR: Signal %d in pid %d (%s)",sig,(int)sys_getpid(),SAMBA_VERSION_STRING));	DEBUG(0,("/nPlease read the Trouble-Shooting section of the Samba3-HOWTO/n"));	DEBUG(0,("/nFrom: http://www.samba.org/samba/docs/Samba3-HOWTO.pdf/n"));	DEBUGSEP(0);  	smb_panic("internal error");	if (cont_fn) {		cont_fn(NULL);#ifdef SIGSEGV		CatchSignal(SIGSEGV,SIGNAL_CAST SIG_DFL);#endif#ifdef SIGBUS		CatchSignal(SIGBUS,SIGNAL_CAST SIG_DFL);#endif#ifdef SIGABRT		CatchSignal(SIGABRT,SIGNAL_CAST SIG_DFL);#endif		return; /* this should cause a core dump */	}	exit(1);}
开发者ID:DeezNuts12,项目名称:freestyledash,代码行数:34,


示例9: start

voidstart(void){	volatile int checker = 0; /* This variable checks that you correctly								gave the child process a new stack. */	pid_t p;	int status;	app_printf("About to start a new process.../n");	p = sys_fork();	if (p == 0)		run_child();	else if (p > 0) {		app_printf("Main process %d!/n", sys_getpid());		do {			status = sys_wait(p);			app_printf("W");		} while (status == WAIT_TRYAGAIN);		app_printf("Child %d exited with status %d!/n", p, status);		// Check whether the child process corrupted our stack.		// (This check doesn't find all errors, but it helps.)		if (checker != 0) {			app_printf("Error: stack collision!/n");			sys_exit(1);		} else			sys_exit(0);	} else {		app_printf("Error!/n");		sys_exit(1);	}}
开发者ID:jamesbvaughan,项目名称:cs111,代码行数:34,


示例10: irix_oplocks_available

static BOOL irix_oplocks_available(void){	int fd;	int pfd[2];	pstring tmpname;	oplock_set_capability(True, False);	slprintf(tmpname,sizeof(tmpname)-1, "%s/koplock.%d", lp_lockdir(), (int)sys_getpid());	if(pipe(pfd) != 0) {		DEBUG(0,("check_kernel_oplocks: Unable to create pipe. Error was %s/n",			 strerror(errno) ));		return False;	}	if((fd = sys_open(tmpname, O_RDWR|O_CREAT|O_EXCL|O_TRUNC, 0600)) < 0) {		DEBUG(0,("check_kernel_oplocks: Unable to open temp test file %s. Error was %s/n",			 tmpname, strerror(errno) ));		unlink( tmpname );		close(pfd[0]);		close(pfd[1]);		return False;	}	unlink(tmpname);	if(sys_fcntl_long(fd, F_OPLKREG, pfd[1]) == -1) {		DEBUG(0,("check_kernel_oplocks: Kernel oplocks are not available on this machine. /Disabling kernel oplock support./n" ));		close(pfd[0]);		close(pfd[1]);		close(fd);		return False;	}
开发者ID:jophxy,项目名称:samba,代码行数:35,


示例11: is_locked

BOOL is_locked(uint16 smbpid,		files_struct * fsp, struct vfs_connection_struct *conn,	       SMB_BIG_UINT count, SMB_BIG_UINT offset,	       enum brl_type lock_type){	int snum = conn->snum;	BOOL ret;	if (count == 0)		return (False);	if (!lp_locking(snum) || !lp_strict_locking(snum))		return (False);	ret = !brl_locktest(fsp->sbuf.st_dev, fsp->sbuf.st_ino, fsp->fnum,			    smbpid, sys_getpid(), conn->snum,			    offset, count, lock_type);	/*	 * There is no lock held by an SMB daemon, check to	 * see if there is a POSIX lock from a UNIX or NFS process.	 */	if (!ret && lp_posix_locking(snum))		ret = is_posix_locked(fsp, offset, count, lock_type);	return ret;}
开发者ID:pombredanne,项目名称:cliffs,代码行数:28,


示例12: parse_dest

static pid_t parse_dest(const char *dest){	pid_t pid;	/* Zero is a special return value for broadcast smbd */	if (strequal(dest, "smbd"))		return 0;	/* Try self - useful for testing */	if (strequal(dest, "self"))		return sys_getpid();	/* Check for numeric pid number */	if ((pid = atoi(dest)) != 0)		return pid;	/* Look up other destinations in pidfile directory */	if ((pid = pidfile_pid(dest)) != 0)		return pid;	fprintf(stderr,"Can't find pid for destination '%s'/n", dest);	return -1;}	
开发者ID:hajuuk,项目名称:R7000,代码行数:28,


示例13: process_main

void process_main(void) {    // Fork a total of three new copies.    pid_t p = sys_fork();    assert(p >= 0);    p = sys_fork();    assert(p >= 0);    // The rest of this code is like p-allocator.c.    p = sys_getpid();    srand(p);    heap_top = ROUNDUP((uint8_t *) end, PAGESIZE);    stack_bottom = ROUNDDOWN((uint8_t *) read_esp() - 1, PAGESIZE);    while (1) {	if ((rand() % ALLOC_SLOWDOWN) < p) {	    if (heap_top == stack_bottom || sys_page_alloc(heap_top) < 0)		break;	    *heap_top = p;	/* check we have write access to new page */	    heap_top += PAGESIZE;	}	sys_yield();    }    // After running out of memory, do nothing forever    while (1)	sys_yield();}
开发者ID:johnlinew,项目名称:CS61-psets,代码行数:29,


示例14: do_winbind_onlinestatus

static bool do_winbind_onlinestatus(struct messaging_context *msg_ctx,				    const struct server_id pid,				    const int argc, const char **argv){	struct server_id myid;	myid = pid_to_procid(sys_getpid());	if (argc != 1) {		fprintf(stderr, "Usage: smbcontrol winbindd onlinestatus/n");		return False;	}	messaging_register(msg_ctx, NULL, MSG_WINBIND_ONLINESTATUS,			   print_pid_string_cb);	if (!send_message(msg_ctx, pid, MSG_WINBIND_ONLINESTATUS, &myid,			  sizeof(myid)))		return False;	wait_replies(msg_ctx, procid_to_pid(&pid) == 0);	/* No replies were received within the timeout period */	if (num_replies == 0)		printf("No replies received/n");	messaging_deregister(msg_ctx, MSG_WINBIND_ONLINESTATUS, NULL);	return num_replies;}
开发者ID:gojdic,项目名称:samba,代码行数:31,


示例15: do_winbind_validate_cache

static bool do_winbind_validate_cache(struct messaging_context *msg_ctx,				      const struct server_id pid,				      const int argc, const char **argv){	struct server_id myid = pid_to_procid(sys_getpid());	if (argc != 1) {		fprintf(stderr, "Usage: smbcontrol winbindd validate-cache/n");		return False;	}	messaging_register(msg_ctx, NULL, MSG_WINBIND_VALIDATE_CACHE,			   winbind_validate_cache_cb);	if (!send_message(msg_ctx, pid, MSG_WINBIND_VALIDATE_CACHE, &myid,			  sizeof(myid))) {		return False;	}	wait_replies(msg_ctx, procid_to_pid(&pid) == 0);	if (num_replies == 0) {		printf("No replies received/n");	}	messaging_deregister(msg_ctx, MSG_WINBIND_VALIDATE_CACHE, NULL);	return num_replies;}
开发者ID:gojdic,项目名称:samba,代码行数:29,


示例16: sys_setpri

// P2 - setting priorityintsys_setpri(void){  //return -10;  int num = -1;  argint(0, &num);  //return num;  if ((num != 1) && (num != 2)) {    return -1;  }  int pid = sys_getpid();  struct proc *p;  //return NPROC;  acquire(&ptable.lock);  for (p = ptable.proc; p < &ptable.proc[NPROC]; p++) {    if (p -> pid == pid) {      if (p -> priority != num) {	p -> priority = num;	break;      }    }  }  release(&ptable.lock);  return 0;}
开发者ID:TheRyanKing87,项目名称:Priority-scheduler,代码行数:30,


示例17: fault_report

/*******************************************************************report a fault********************************************************************/static void fault_report(int sig){	static int counter;	if (counter) _exit(1);	counter++;	DEBUG(0,("===============================================================/n"));	DEBUG(0,("INTERNAL ERROR: Signal %d in pid %d (%s)",sig,(int)sys_getpid(),VERSION));	DEBUG(0,("/nPlease read the file BUGS.txt in the distribution/n"));	DEBUG(0,("===============================================================/n"));  	smb_panic("internal error");	if (cont_fn) {		cont_fn(NULL);#ifdef SIGSEGV		CatchSignal(SIGSEGV,SIGNAL_CAST SIG_DFL);#endif#ifdef SIGBUS		CatchSignal(SIGBUS,SIGNAL_CAST SIG_DFL);#endif		return; /* this should cause a core dump */	}	exit(1);}
开发者ID:livebox,项目名称:livebox2,代码行数:30,


示例18: xmutex_lock

sigset_txmutex_lock(struct xmutex * lock){	TRACE(MUTEX, "thread %d:%d is locking %p/n",			sys_getpid(), sys_gettid(), lock);	int c;	sigset_t sigset = block_signals();	if ((c = atomic_cmpxchg(&lock->val, 0, 1)) != 0) {		do {			if (c == 2 || atomic_cmpxchg(&lock->val, 1, 2) != 0)				futex_wait(&lock->val, 2);		} while ((c = atomic_cmpxchg(&lock->val, 0, 2)) != 0);	}	TRACE(MUTEX, "thread %d:%d gained lock %p/n",			sys_getpid(), sys_gettid(), lock);	return sigset;}
开发者ID:forhappy,项目名称:libloader,代码行数:17,


示例19: get_rand_seed

/** * Use a TDB to store an incrementing random seed. * * Initialised to the current pid, the very first time Samba starts, * and incremented by one each time it is needed. * * @note Not called by systems with a working /dev/urandom. */static void get_rand_seed(void *userdata, int *new_seed){	*new_seed = sys_getpid();	if (db_ctx) {		dbwrap_trans_change_int32_atomic(db_ctx, "INFO/random_seed",						 new_seed, 1);	}}
开发者ID:srimalik,项目名称:samba,代码行数:16,


示例20: pmain

voidpmain(void){	volatile int checker = 30; /* This variable checks for some common				      stack errors. */	pid_t p;	int i, status;	app_printf("About to start a new process.../n");	p = sys_fork();	if (p == 0) {		// Check that the kernel correctly copied the parent's stack.		check(checker, 30, "new child");		checker = 30 + sys_getpid();		// Yield several times to help test Exercise 3		app_printf("Child process %d!/n", sys_getpid());		for (i = 0; i < 20; i++)			sys_yield();		// Check that no one else corrupted our stack.		check(checker, 30 + sys_getpid(), "end child");		sys_exit(1000);	} else if (p > 0) {		// Check that the child didn't corrupt our stack.		check(checker, 30, "main parent");		app_printf("Main process %d!/n", sys_getpid());		do {			status = sys_wait(p);		} while (status == WAIT_TRYAGAIN);		app_printf("Child %d exited with status %d!/n", p, status);		check(status, 1000, "sys_wait for child");		// Check again that the child didn't corrupt our stack.		check(checker, 30, "end parent");		sys_exit(0);	} else {		app_printf("Error!/n");		sys_exit(1);	}}
开发者ID:js6450,项目名称:Operating-Systems,代码行数:45,


示例21: pidfile_create

/* create a pid file in the pid directory. open it and leave it locked */void pidfile_create(const char *program_name){	int     fd;	char    buf[20];	char    *short_configfile;	pstring name;	pstring pidFile;	pid_t pid;	/* Add a suffix to the program name if this is a process with a	 * none default configuration file name. */	if (strcmp( CONFIGFILE, dyn_CONFIGFILE) == 0) {		strncpy( name, program_name, sizeof( name)-1);	} else {		short_configfile = strrchr( dyn_CONFIGFILE, '/');		if (short_configfile == NULL) {			/* conf file in current directory */			short_configfile = dyn_CONFIGFILE;		} else {			/* full/relative path provided */			short_configfile++;		}		slprintf( name, sizeof( name)-1, "%s-%s", program_name,			  short_configfile );	}	slprintf(pidFile, sizeof(pidFile)-1, "%s/%s.pid", lp_piddir(), name);	pid = pidfile_pid(name);	if (pid != 0) {		DEBUG(0,("ERROR: %s is already running. File %s exists and process id %d is running./n", 			 name, pidFile, (int)pid));		exit(1);	}	fd = sys_open(pidFile, O_NONBLOCK | O_CREAT | O_WRONLY | O_EXCL, 0644);	if (fd == -1) {		DEBUG(0,("ERROR: can't open %s: Error was %s/n", pidFile, 			 strerror(errno)));		exit(1);	}	if (fcntl_lock(fd,SMB_F_SETLK,0,1,F_WRLCK)==False) {		DEBUG(0,("ERROR: %s : fcntl lock of file %s failed. Error was %s/n",                name, pidFile, strerror(errno)));		exit(1);	}	memset(buf, 0, sizeof(buf));	slprintf(buf, sizeof(buf) - 1, "%u/n", (unsigned int) sys_getpid());	if (write(fd, buf, strlen(buf)) != (ssize_t)strlen(buf)) {		DEBUG(0,("ERROR: can't write to file %s: %s/n", 			 pidFile, strerror(errno)));		exit(1);	}	/* Leave pid file open & locked for the duration... */}
开发者ID:WiseMan787,项目名称:ralink_sdk,代码行数:58,


示例22: irix_oplocks_available

static BOOL irix_oplocks_available(void){	int fd;	int pfd[2];	pstring tmpname;	set_effective_capability(KERNEL_OPLOCK_CAPABILITY);	slprintf(tmpname,sizeof(tmpname)-1, "%s/koplock.%d", lp_lockdir(),		 (int)sys_getpid());	if(pipe(pfd) != 0) {		DEBUG(0,("check_kernel_oplocks: Unable to create pipe. Error "			 "was %s/n",			 strerror(errno) ));		return False;	}	if((fd = sys_open(tmpname, O_RDWR|O_CREAT|O_EXCL|O_TRUNC, 0600)) < 0) {		DEBUG(0,("check_kernel_oplocks: Unable to open temp test file "			 "%s. Error was %s/n",			 tmpname, strerror(errno) ));		unlink( tmpname );		close(pfd[0]);		close(pfd[1]);		return False;	}	unlink(tmpname);	if(sys_fcntl_long(fd, F_OPLKREG, pfd[1]) == -1) {		DEBUG(0,("check_kernel_oplocks: Kernel oplocks are not "			 "available on this machine. Disabling kernel oplock "			 "support./n" ));		close(pfd[0]);		close(pfd[1]);		close(fd);		return False;	}	if(sys_fcntl_long(fd, F_OPLKACK, OP_REVOKE) < 0 ) {		DEBUG(0,("check_kernel_oplocks: Error when removing kernel "			 "oplock. Error was %s. Disabling kernel oplock "			 "support./n", strerror(errno) ));		close(pfd[0]);		close(pfd[1]);		close(fd);		return False;	}	close(pfd[0]);	close(pfd[1]);	close(fd);	return True;}
开发者ID:StephenMacras,项目名称:dsl-n55u-bender,代码行数:56,


示例23: dbghdr

BOOL dbghdr( int level, const char *file, const char *func, int line ){  /* Ensure we don't lose any real errno value. */  int old_errno = errno;  if( format_pos ) {    /* This is a fudge.  If there is stuff sitting in the format_bufr, then     * the *right* thing to do is to call     *   format_debug_text( "/n" );     * to write the remainder, and then proceed with the new header.     * Unfortunately, there are several places in the code at which     * the DEBUG() macro is used to build partial lines.  That in mind,     * we'll work under the assumption that an incomplete line indicates     * that a new header is *not* desired.     */    return( True );  }#ifdef WITH_SYSLOG  /* Set syslog_level. */  syslog_level = level;#endif  /* Don't print a header if we're logging to stdout. */  if( stdout_logging )    return( True );  /* Print the header if timestamps are turned on.  If parameters are   * not yet loaded, then default to timestamps on.   */  if( lp_timestamp_logs() || !(lp_loaded()) ) {    char header_str[200];	header_str[0] = '/0';	if( lp_debug_pid())	  slprintf(header_str,sizeof(header_str)-1,", pid=%u",(unsigned int)sys_getpid());	if( lp_debug_uid()) {      size_t hs_len = strlen(header_str);	  slprintf(header_str + hs_len,               sizeof(header_str) - 1 - hs_len,			   ", effective(%u, %u), real(%u, %u)",               (unsigned int)geteuid(), (unsigned int)getegid(),			   (unsigned int)getuid(), (unsigned int)getgid()); 	}      /* Print it all out at once to prevent split syslog output. */    (void)Debug1( "[%s, %d%s] %s:%s(%d)/n",                  timestring(lp_debug_hires_timestamp()), level,				  header_str, file, func, line );  }  errno = old_errno;  return( True );}
开发者ID:jophxy,项目名称:samba,代码行数:56,


示例24: do_lock

static NTSTATUS do_lock(files_struct *fsp,connection_struct *conn, uint16 lock_pid,		 SMB_BIG_UINT count,SMB_BIG_UINT offset,enum brl_type lock_type){	NTSTATUS status;	if (!lp_locking(SNUM(conn)))		return NT_STATUS_OK;	/* NOTE! 0 byte long ranges ARE allowed and should be stored  */	DEBUG(10,("do_lock: lock type %s start=%.0f len=%.0f requested for file %s/n",		  lock_type_name(lock_type), (double)offset, (double)count, fsp->fsp_name ));	if (OPEN_FSP(fsp) && fsp->can_lock && (fsp->conn == conn)) {		status = brl_lock(fsp->dev, fsp->inode, fsp->fnum,				  lock_pid, sys_getpid(), conn->cnum,				  offset, count,				  lock_type);		if (NT_STATUS_IS_OK(status) && lp_posix_locking(SNUM(conn))) {			/*			 * Try and get a POSIX lock on this range.			 * Note that this is ok if it is a read lock			 * overlapping on a different fd. JRA.			 */			if (!set_posix_lock(fsp, offset, count, lock_type)) {				status = NT_STATUS_LOCK_NOT_GRANTED;				/*				 * We failed to map - we must now remove the brl				 * lock entry.				 */				(void)brl_unlock(fsp->dev, fsp->inode, fsp->fnum,								lock_pid, sys_getpid(), conn->cnum,								offset, count, False);			}		}	}	return status;}
开发者ID:livebox,项目名称:livebox2,代码行数:43,



注:本文中的sys_getpid函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ sys_inb函数代码示例
C++ sys_getenvid函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。