linux¶à½ø³Ì¶àÏß³ÌÎÊÌâ
ÕâÀïΪʲô×Ó½ø³Ì´´½¨µÄÏß³ÌIDÏàͬµÄ£¿
C/C++ code:
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <pthread.h>
static int temp;
void
thread1 (void *arg)
{
pthread_t thid = pthread_self ();
printf ("thread1 Current thread's ID is %d \n", (int) thid);
printf ("thread1 ends\n");
}
void
thread3 (void *arg)
{
pthread_t thid = pthread_self ();
printf ("thread3 Current thread's ID is %d \n", (int) thid);
printf ("thread3 ends\n");
}
void
thread2 (void *arg)
{
pthread_t thid = pthread_self ();
printf ("thread2 Current thread's ID is %d\n", (int) thid);
printf ("thread2 ends\n");
}
void createthread()
{
pthread_t thid1,thid2;
if(pthread_create(&thid1, NULL, thread1, NULL) != 0) {
printf("thread creation failed\n");
exit(1);
}
if(pthread_create(&thid2, NULL, thread2, NULL) != 0) {
printf("thread creation failed\n");
exit(1);
}
}
int
main()
{
pid_t status;
int i,j;
printf ("Process Creation Study ppid= %d,pid=%d\n",getppid(),getpid());
for (i = 0; i < 4; i++)
{
status = fork ();
sleep (2);
if (status == 0)
{
printf ("Child process is running,CurPid is %d,P
Ïà¹ØÎÊ´ð£º
ʹÓÃPHPµÄexecº¯Êýµ÷ÓÃlinuxµÄshellÃüÁÈçdateÈ¥ÐÞ¸Äʱ¼ä»òshutdownȥʵÏֹػú/ÖØÆô£¬µ«ÊÇ·µ»ØÖµ¶¼ÊÇʧ°ÜµÄ¡£¾¹ý¶à´ÎÊÔÑ飬È϶¨ÊÇûÓÐȨÏÞµÄÎÊÌâ¡£
ËùÒÔ£¬Ð¡µÜÔÚ´ËÇë½Ì¸÷룬ÈçºÎ²ÅÄÜÉèÖÃȨÏÞ£¬µ÷ÓÃlinux shellà ......
ÔÚlinuxÏÂдµÄһЩС³ÌÐòºÍ½Å²½£¬Ã¿´ÎÒªÔËÐж¼ÓÐÇл»µ½ËüËùÔÚµÄĿ¼£¬
ÔõÑùÈÃËüÔÚÆäËûĿ¼Ҳ¿ÉÒÔÓÃÄØ£¿¾ÍÈçÓÃvi»òlsÕâЩÃüÁîÒ»Ñù
³¢ÊÔ¹ýÌí¼Ó»·¾³±äÁ¿£¬µ«²»³É¹¦£¬²»¶®
ûÓÐÈ˻شð
ÏñviÄÇЩ£¬ËüÃÇËùÔÚµÄĿ¼¶¼Å ......
ÔÚ×Ô¼ºµÄµçÄÔÉϰ²×°ÁËubuntu ¾ÍÊÇÏëÍæÒ»ÏÂ3D×ÀÃæ£¬ÓÚÊÇÏÂÔØÁË
compizconfig-settings-manager
emerald
simple-ccsm
fusion
ÕâЩ¶«Î÷£¬°²×°ÍêÖ®ºó£¬ÎÒÔÚµçÄÔÀïµã»÷ÁËemerald ......
´úÂëÌ«¶à£¬²»ºÃÌù£¬
´óÖÂÉæ¼°µ½ÕâЩ£º
char *arg[MAXSIZE];
char *buffer[MAXSIZE];
.........
arg[k]=(char*)malloc(sizeof(char)*j);
strcpy(arg[k],buffer);
.................[color=#993300][/color]
µ ......