Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

linux½ø³Ì¼äͨÐÅ(¹ÜµÀ)µÄÎÊÌâ

linux½ø³Ì¼äͨÐÅ(¹ÜµÀ)µÄÎÊÌâ

#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <memory.h>

int main()
{
pid_t result;
int r_num;
int pipe_fd[2];
char buf_r[100];
memset(buf_r,0,sizeof(buf_r));
if(pipe(pipe_fd) <0){
  printf("´´½¨¹ÜµÀʧ°Ü");
  return -1;
}
result=fork();
if(result <0){
  printf("´´½¨×Ó½ø³Ìʧ°Ü");
  exit;
}
else if(result==0){
  sleep(5);
  close(pipe_fd[1]);
  if((r_num=read(pipe_fd[0],buf_r,100))>0){
  printf("×Ó½ø³Ì´Ó¹ÜµÀ¶ÁÈ¡%d¸ö×Ö·û,¶ÁÈ¡µÄ×Ö·û´®ÊÇ:%s\n",r_num,buf_r);
  }
  close(pipe_fd[0]);
  exit(0);
}
else{
  close(pipe_fd[0]);
  if(write(pipe_fd[1],"µÚÒ»´®ÎÄ×Ö",10)!=-1)
  printf("¸¸½ø³ÌÏò¹ÜµÀдÈë µÚÒ»´®×Ö·û !\n");
  if(write(pipe_fd[1],"µÚ¶þ´®ÎÄ×Ö",10)!=-1)
  printf("¸¸½ø³ÌÏò¹ÜµÀдÈë µÚ¶þ´®×Ö·û !\n");
  close(pipe_fd[1]);
  waitpid(result,NULL,0);
  exit(0);
}
}
ÆÚÍûµÄ½á¹ûÊÇ:

¸¸½ø³ÌÏò¹ÜµÀдÈë µÚÒ»´®×Ö·û !
¸¸½ø³ÌÏò¹ÜµÀдÈë µÚ¶þ´®×Ö·û !


Ïà¹ØÎÊ´ð£º

linux»·¾³ÏÂgethostbynameº¯ÊýÎÊÌâ - C/C++ / CÓïÑÔ

дÁ˸ö²âÊÔ³ÌÐòÈçÏÂ
   
  struct hostent *hp; 
char AlarmDevIP[20];  
  int x2;

hp = gethostbyname("www.google.com");
if (hp)
{ ......

ʹÓÃStruts2ÉÏ´«Îļþ£¬ÔÚlinuxϱ¨´í

ʹÓÃStruts2ÉÏ´«Îļþ£¬ÔÚlinuxϱ¨´í
2009-09-29 14:56:20,801 [org.apache.struts2.interceptor.FileUploadInterceptor]-[ERROR] Processing of multipart/form-data request failed. c:/temp/upload__1dcd07ee_12 ......

php±àдִÐÐlinux shellÃüÁîµÄ´úÂë

ʹÓÃPHPµÄexecº¯Êýµ÷ÓÃlinuxµÄshellÃüÁÈçdateÈ¥ÐÞ¸Äʱ¼ä»òshutdownȥʵÏֹػú/ÖØÆô£¬µ«ÊÇ·µ»ØÖµ¶¼ÊÇʧ°ÜµÄ¡£¾­¹ý¶à´ÎÊÔÑ飬È϶¨ÊÇûÓÐȨÏÞµÄÎÊÌâ¡£
ËùÒÔ£¬Ð¡µÜÔÚ´ËÇë½Ì¸÷룬ÈçºÎ²ÅÄÜÉèÖÃȨÏÞ£¬µ÷ÓÃlinux shellà ......

¸ü¸ÄlinuxĿ¼

Ó¦ÓÃϵͳÊǰ²×°ÔÚ /opt Ŀ¼Ï£¬/opt Ŀ¼ÊÇÊôÓÚ¸ùĿ¼ / ϵġ£ÁíÍâÒ»¸öÎļþϵͳµÄ¹ÒÔØµãÊÇÔÚ/aaaĿ¼Ï£¬¿É·ñ½«/optĿ¼ÏµÄËùÓÐÎļþcopyµ½/aaaĿ¼Ï£¬umount ÔÚ/aaaĿ¼ÏµĹÒÔØµã£¬½«/aaa¸ÄÃû/optĿ¼£¬ÔÙ½«Ô­À ......

Çólinux time ÃüÁîµÄʵÏÖ´úÂë

ÈçÌ⣬лл

LinuxÊÇ¿ªÔ´µÄ£¬ÄãËÑË÷LinuxÔ´³ÌÐòĿ¼¾Í¿ÉÒÔÕÒµ½shellÃüÁîtimeµÄʵÏÖ´úÂë¡£

kernel/time.c

ÄãµÄÍ·ÏñºÜ²»´íѽ

ʹÓú¯ÊýtimeΪ½ø³ÌÌṩµ±Ç°µÄʱ¼ä
#include<time.h>
time_t time(time ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ