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

Linux ¾ªÈºÏÖÏó

        ÔÚlinuxÖУ¬¾ªÈºÏÖÏóÒѾ­ÏûʧÁ˵ģ¬ÎÒÃÇ¿ÉÒÔ¿´   http://simohayha.javaeye.com/blog/561424 £¬µ«Êǵ±ÎÒÃÇÔÚ¿ª·¢·þÎñÆ÷ʱºò£¬ÐèҪʹÓÃepoll£¬·¢ÏÖÒ»¸öÎÊÌ⣬¾ÍÊǵ±Ò»¸öÇëÇó¹ýÀ´µÄʱºò£¬·¢ÏÖÓеÄʱºò±»»½ÆðµÄ½ø³Ì²»Ö¹Ò»¸ö£¬¿´ÏÂÃæµÄ³ÌÐò:#include <sys/socket.h>
#include <sys/epoll.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <pthread.h>
#include <errno.h>
#include <unistd.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <errno.h>
#define KEY 1234
#define SIZE 1024
#define PORT 9999
#define MAXFDS 5000
#define EVENTSIZE 100
void process();
int fd, cfd,opt=1;
int shmid;
char *shmaddr;
struct shmid_ds buf;
int num = 0 ;
int main(int argc, char *argv[])
{
shmid = shmget(KEY,SIZE,IPC_CREAT|0600); /* ½¨Á¢¹²ÏíÄÚ´æ */
if(shmid == -1){
printf("create share memory failed\n");
}
shmaddr = (char *)shmat(shmid,NULL,0);
if(shmaddr == (void *)-1){
printf("connect to the share memory failed: %s",strerror(errno));
return 0;
}
strcpy(shmaddr,"1\n");

struct sockaddr_in sin, cin;
socklen_t sin_len = sizeof(struct sockaddr_in);
if ((fd = socket(AF_INET, SOCK_STREAM, 0)) <= 0)
{
fprintf(stderr, "socket failed\n");
return -1;
}
memset(&sin, 0, sizeof(struct sockaddr_in));
sin.sin_family = AF_INET;
sin.sin_port = htons((short)(PORT));
sin.sin_addr.s_addr = INADDR_ANY;
if (bind(fd, (struct sockaddr *)&sin, sizeof(sin)) != 0)
{
fprintf(stderr, "bind failed\n");
return -1;
}
if (listen(fd, 32) != 0)
{
fprintf(stderr, "listen failed\n");
return -1;
}
int i ;
for(i = 0; i < 2; i++)
{
int pid = fork();
if(pid == 0)
{


Ïà¹ØÎĵµ£º

¡¾Nutch¡¿LinuxÏÂÓ¦ÓÃnutch 1.0 Webǰ¶ËʵÏÖµ¥»ú¼ìË÷

nutchµÄÅÀ³æºÍËÑË÷¿ÉÒÔ˵ÊÇ·ÖÀëµÄÁ½¿é£¬ÅÀ³æ¿ÉÒÔÊÇM/R×÷Òµ£¬µ«ËÑË÷²»ÊÇM/R×÷Òµ¡£ËÑË÷ÓÐÁ½ÖÖ·½Ê½£ºÒ»Êǽ«ÅÀ³æÊý¾Ý(»òÕß³ÆË÷ÒýÊý¾Ý)·ÅÔÚ±¾µØÓ²ÅÌ£¬½øÐÐËÑË÷¡£¶þÊÇÖ±½ÓËÑË÷HDFSÖеÄÅÀ³æÊý¾Ý¡£
ÕâÀï½éÉÜÈçºÎʹÓÃnutch-1.0µÄWEBǰ¶Ë¼ìË÷±¾µØÅÀ³æÊý¾Ý£º
(1)NutchµÄËÑË÷¿ÉÒÔ¶ÀÁ¢ÓÚhadoop¼¯Èº£¬Ö»Òª½«ÅÀ³æÏÂÀ´µÄÊý¾Ýcopyµ½ÈκλúÆ ......

UbuntuÉϽ¨Á¢Arm Linux ¿ª·¢»·¾³

Ä¿µÄ£º
°ÑARM linuxµÄ½»²æ¿ª·¢»·¾³£¬kernel, filesystem,
bootloder°²×°£¬²¢ÅäÖã¬Ê¹Æä¿ÉÒÔ±àÒëbootloder, kernel, ¿ÉÒÔnfs¸üÐÂÎļþϵͳ£»
×ÊÔ´£º
´úÂë:
arm-linux-toolchains.tgz
matrix5-kernel-v5.5.tgz
vivi.tar.gz
Jflash.tgz
root-for-nfs-v5.5.tgz
¹æ»®£º
½»²æ±àÒëÆ÷×°ÔÚ£º/usr/local/
ker ......

windowsµÇ½Զ³ÌLinuxÖ÷»úµÄÒ»ÖÖ;¾¶putty

windowsµÇ½Զ³ÌLinuxÖ÷»úµÄÒ»ÖÖ;¾¶putty£­Ïêϸ°²×°Ê¹Óùý³Ì
×÷Õߣºgliethttp
Èç¹ûÄã´òËãÔÚwindowsÏ·ÃÎÊÁíÍâһ̨װÓÐLinuxµÄ»ú×Ó£¬ÄÇÃ´ÍÆ¼öʹÓÃputty
SSHÌṩÁ½ÖÖ¼¶±ðµÄ°²È«ÑéÖ¤: Ò»ÊÇ»ùÓÚ¿ÚÁîµÄ°²È«ÑéÖ¤¡£Ö»ÒªÓû§ÖªµÀ×Ô¼ºÕ˺źͿÚÁ¾Í¿ÉÒԵǼµ½Ô¶³ÌÖ÷»ú¡£ËùÓд«ÊäµÄÊý¾Ý¶¼»á±»¼ÓÃÜ£¬µ«ÊDz»Äܱ£Ö¤Óû§ÕýÔÚÁ¬½ÓµÄ·þ ......

LinuxÍü¼ÇÃÜÂëÔõô°ì£¿

1. ÔÚ³öÏÖgrub»­ÃæÊ±£¬ÓÃÉÏϼüÑ¡ÖÐÄãÆ½Ê±Æô¶¯linuxµÄÄÇÒ»Ïî(±ðÑ¡dosÓ´)£¬È»ºó°´e¼ü
2. ÔÙ´ÎÓÃÉÏϼüÑ¡ÖÐÄãÆ½Ê±Æô¶¯linuxµÄÄÇÒ»Ïî(ÀàËÆÓÚkernel /boot/vmlinuz-2.4.18-14 ro root=LABEL=/)£¬È»ºó°´e¼ü
3. ÐÞ¸ÄÄãÏÖÔÚ¼ûµ½µÄÃüÁîÐУ¬¼ÓÈësingle£¬½á¹ûÈçÏ£º
kernel /boot/vmlinuz-2.4.18-14 single ro root=LABEL=/
4 ......

linux shellÖÖÀà

LinuxÖеÄshellÓжàÖÖÀàÐÍ£¬ÆäÖÐ×î³£Óõļ¸ÖÖÊÇBourne   shell£¨sh£©¡¢C   shell£¨csh£©ºÍKorn   shell£¨ksh£©¡£ÈýÖÖshell¸÷ÓÐÓÅȱµã¡£Bourne   shellÊÇUNIX×î³õʹÓõÄshell£¬²¢ÇÒÔÚÿÖÖUNIXÉ϶¼¿ÉÒÔʹÓá£Bourne   shellÔÚshell±à³Ì·½ÃæÏ൱ÓÅÐ㣬µ«ÔÚ´¦ÀíÓëÓû§µÄ½»»¥ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ