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

linuxÁ½¸ö³ÌÐòͨ¹ý¹²ÏíÄÚ´æÍ¨ÐŵÄÒ»¸ö¼òµ¥Àý×Ó

д¹²ÏíÄÚ´æ³ÌÐò£º
/*
* File: server.cpp
* Author: centos
*˵Ã÷£º´Ó¼üÅ̶ÁÈëÊý¾Ý£¬´æ·ÅÔÚ¹²ÏíÄÚ´æÖС£
* Created on 2010Äê3ÔÂ1ÈÕ, ÏÂÎç3:44
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#define BUF_SIZE 1024
#define MYKEY 114
int main(int argc, char** argv)
{
int shmid;
char *shmptr;
struct shmid_ds shmbuf;
system("ipcrm -M114"); //µ÷ÊÔ³ÌÐòʱÓÃ
shmid = shmget(MYKEY, BUF_SIZE, (IPC_CREAT |0777) );
if ( -1 == shmid )
{
printf("server shmget error!\n");
fprintf(stderr, "Error: %d - %s\n", errno, strerror(errno));
exit(1);
}
shmptr = (char *) (shmat(shmid, 0, 0)) ;
if ( -1 == (int) shmptr )
{
printf("server shmat error!\n");
fprintf(stderr, "Error: %d - %s\n", errno, strerror(errno));
if(shmctl(shmid,IPC_RMID,&shmbuf) < 0)
{
perror("shmctl error");
fprintf(stderr, "Error: %d - %s\n", errno, strerror(errno));
}
exit(1);
}
strcpy(shmptr,"this is a test. \n");
while(1)
{
printf("Please input:");
scanf("%s",shmptr) ;
while ('\n' != getchar() );
// fflush(stdin);
// printf("your input: %s\n", shmptr);
if (! strcmp(shmptr,"quit")) break;
}
shmdt(shmptr);
if(shmctl(shmid,IPC_RMID,&shmbuf) < 0) perror("shmctl error");
return (EXIT_SUCCESS);
}

¶Á¹²ÏíÄÚ´æµÄ³ÌÐò£º
/*
 * File:   main.cpp
 * Author: centos
 *
˵Ã÷£º´Ó¹²ÏíÄÚ´æÖжÁÈ¡Êý¾Ý£¬ÏÔʾµ½ÆÁÄ»ÉÏ¡£
 * Created on 2010Äê3ÔÂ2ÈÕ, ÉÏÎç10:47
 */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#define BUF_SIZE 1024
#define M


Ïà¹ØÎĵµ£º

װLinuxϵͳ

½ñÌì×°ÁËÒ»ÌìµÄLinuxϵͳ£¬ÓëÆä˵°²×°»¹²»Èç˵ÊÇÏÂÔØÁËÒ»Ì죬ÏȺó×°ÁËfedora core 4£¬fedora core 6£¬×îºó×°fedora core 8ÖÕÓÚ¿ÉÒÔÓÃÁË£¬Ã¿¸ö¶¼ÊÇ3G¶à£¬ÒòΪÔÚѧУµÄ¹¤×÷ÊÒ£¬ËùÒÔÏÂÔØËÙ¶ÈÆ½¾ù¿ÉÒÔ´ïµ½1.9M²»µ½£¬Õâ¿ÉÊÇÏÞËٵ쬾ÍËãÕâÑùÎҵĵçÄÔÒ²ÒòΪÏÂÔØËÙ¶ÈÌ«¿ìËÀÁËN»ØÁË£¬¶¼ÊÇÇ¿ÖÆPowerµÄ£¬ÕæµÃ×°µÃÓеãÓôÃÆ°¡£¬×°FC4ÊÇÒ ......

linuxÐźűí


Linuxϲ鿴֧³ÖµÄÐźÅÁбí:
~$ kill -l
1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL
5) SIGTRAP 6) SIGABRT 7) SIGBUS 8) SIGFPE
9) SIGKILL 10) SIGUSR1 11) SIGSEGV 12) SIGUSR2
13) SIGPIPE 14) SIGALRM 15) SIGTERM 17) SIGCHLD
18) SIGCONT 19) SIGSTOP 20) SIGTSTP 21) SIGTTIN
22) SIGTTOU 23) SIGUR ......

LINUX ϰ²×°TFTP·þÎñ

TFTPÊÇÓÃÀ´ÏÂÔØÔ¶³ÌÎļþµÄ×î¼òµ¥ÍøÂçЭÒ飬Ëü»ùÓÚUDPЭÒé¶øÊµÏÖ¡£Ç¶ÈëʽlinuxµÄtftp¿ª·¢»·¾³°üÀ¨Á½¸ö·½Ã棺һÊÇǶÈëʽlinuxËÞÖ÷»úµÄ tftp-serverÖ§³Ö£¬¶þÊÇǶÈëʽlinuxÄ¿±ê»úµÄtftp-clientÖ§³Ö¡£ÒòΪu-boot±¾ÉíÄÚÖÃÖ§³Ötftp-client£¬ËùÒÔǶÈëʽĿ±ê»ú¾Í²»ÓÃÅäÖÃÁË¡£ÏÂÃæ¾ÍÏêϸ½éÉÜÒ»ÏÂlinuxËÞÖ÷»útftp-serverµÄ°²×°ÅäÖá£
......

linux϶¨Ê±Ö´Ðмƻ®ÈÎÎñ


linux϶¨Ê±Ö´Ðмƻ®ÈÎÎñ
²é¿´/etc/crontabÎļþ
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cr ......

linux tcʵÏÖipÁ÷Á¿ÏÞÖÆ

tcÊǸöÅäÖÃLinuxÄÚºËÁ÷Á¿¿ØÖƵŤ¾ß Ãû×Ö tc - ÏÔʾ£¯Î¬»¤Á÷Á¿¿ØÖÆÅäÖà ժҪ tc qdisc [ add | change | replace | link ] dev DEV [ parent qdisc-id | root ] [ handle qdisc-id ] qdisc [ qdisc specific parameters ] tc class [ add | change | replace ] dev DEV parent qdisc-id [ classid class-id ] qd ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ