linuxϵĶ˿ÚɨÃè¼¼Êõ£¡
Õâ¸öÊÇÎÒÔÚÒ»±¾ÊéÉÏ¿´µ½µÄ£¬ÆäÖеÄһЩ´úÂëÎÒÓÐËù¸Ä±ä£¬Ð´¸ø¸÷λºÃÓѹ²Ïíһϣ¡
#include <sys/types.h>
#include <sys/socket.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <errno.h>
#include "my_recv.h" // ×Ô¶¨ÒåµÄÍ·Îļþ
#define SERV_PORT 4507 // ·þÎñÆ÷¶ËµÄ¶Ë¿Ú
#define LISTENQ 12 // Á¬½ÓÇëÇó¶ÓÁеÄ×î´ó³¤¶È
#define INVALID_USERINFO 'n' // Óû§ÐÅÏ¢ÎÞЧ
#define VALID_USERINFO 'y' // Óû§ÐÅÏ¢ÓÐЧ
#define USERNAME 0 // ½ÓÊÕµ½µÄÊÇÓû§Ãû
#define PASSWORD 1 // ½ÓÊÕµ½µÄÊÇÃÜÂë
struct userinfo { // ±£´æÓû§ÃûºÍÃÜÂëµÄ½á¹¹Ìå
char username[32];
char password[32];
};
struct userinfo users[ ] = {
{"linux", "unix"},
{"4507", "4508"},
{"clh", "clh"},
{"xl", "xl"},
{" "," "} // ÒÔÖ»º¬Ò»¸ö¿Õ¸ñµÄ×Ö·û´®×÷ΪÊý×éµÄ½áÊø±êÖ¾
};
// ²éÕÒÓû§ÃûÊÇ·ñ´æÔÚ£¬´æÔÚ·µ»Ø¸ÃÓû§ÃûµÄϱê,²»´æÔÚÔò·µ»Ø-1£¬³ö´í·µ»Ø-2
int find_name(const char *name)
{
int i;
if (name == NULL) {
printf("in find_name, NULL pointer");
return -2;
}
for (i=0; users[i].username[0] != ' ';i++) {
if (strcmp(users[i].username, name) == 0) {
return i;
}
}
return -1;
}
// ·¢ËÍÊý¾Ý
void send_data(int conn_fd, const char *string)
{
if (send(conn_fd, string, strlen(string), 0) < 0) {
my_err("send", __LINE__); // my_errº¯ÊýÔÚmy_recv.hÖÐÉùÃ÷
}
}
int main()
{
int sock_fd, conn_fd;
int optval;
int flag_recv = USERNAME; // ±êʶ½ÓÊÕµ½µÄÊÇÓû§»¹ÊÇÃÜÂë
int ret;
int name_num;
pid_t pid;
socklen_t&
Ïà¹ØÎĵµ£º
ÓÃSSHµÇ½Զ³ÌµÄlinux·þÎñÆ÷»òÓÃwinä¯ÀÀÔËÐÐsambaµÄlinux·þÎñÆ÷ÖÐÓÐÖÐÎÄÃûµÄÎļþ¼ÐµÄʱºò£¬¿´µ½ÀïÃæµÄÖÐÎÄÎļþÃû¶¼ÊÇÂÒÂ룬±à¼ÎĵµµÄʱºò¶¼ÊÇ´®Ðеģ¬Ã¿´ÎÒªexport LANG=enÂé·³ËÀÁË¡£
ÉÏÍøËÄ´¦ËÑË÷£¬Çó½Ì¸ßÈË£¬µÃ´Ë°ì·¨¡£
(1) ´ò¿ª/etc/sysconfig/i18n
ÉèÖÃΪ£º
LANG="zh_CN.GB2312"
LANGUAGE="zh_CN.GB18030:zh_CN ......
Ò»°ãÀ´Ëµ£¬Ä¿Ç°Ð°æµÄ Linux Ô¤Éè¿ÉÒÔÖ§³ÖµÄÍøÂ翨оƬ×éÊýÁ¿ÒѾºÜÍ걸ÁË£¬ºÜ¶àÍøÂ翨оƬ¶¼ÒѾ±»Ö§³Ö,ÀýÈçRLT 8139 оƬ ( RealTek 8139 ) µÄÍøÂ翨ËùÒÔʹÓÃÕß¿ÉÒÔºÜÇáÒ×µÄÉ趨ºÃËûÃǵÄÍøÂ翨¡£²»¹ý£¬Èç¹ûÍòÒ»²»ÐÒºËÐÄûÓÐÖ§³Ö¸ÃÍøÂ翨µÄ»°£¬ÄÇô¿ÉÒÔ͸¹ýÖØбàÒëºËÐÄ»òÕß±àÒëÍøÂ翨Çý¶¯Ä£¿é ( Modul ......
1.ÏÂÔØmemcached·þÎñÆ÷¶Ë°²×°Îļþ
°æ±¾£º
memcached-1.4.2.tar.gz
ÏÂÔصØÖ·£ºhttp://www.danga.com/memcached/download.bml
2.ÏÂÔØlibevent£¬memcachedÐèÒªÓõ½socked£¬ÒÀÀµ´Ë°²×°Îļþ¡£
°æ±¾£º
libevent-1.4.12-stable.tar.gz
ÏÂÔصØÖ·£ºhttp:/ ......
½Ó´¥linuxʱ¼ä»¹²»ÊǺܳ¤,ºÜ¶àÃüÁî¼Ç²»×¡,ºÇºÇ,Äõ½Ð·þÎñÆ÷¿´ÏÂÓ²ÅÌ·ÖÇø $df –lh Îļþϵͳ ÈÝÁ¿ ÒÑÓà ¿ÉÓà ÒÑÓÃ% ¹ÒÔصã
/dev/sda1 2.0G ......
LinuxͼÐνçÃæÖпͻ§¶Ë¡¢·þÎñÆ÷¡¢´°¿Ú¹ÜÀíÆ÷Ö®¼äµÄ¹Øϵ
×÷Õߣº
ÁõºéÌΣ¬»ªÇåÔ¶¼ûǶÈëʽѧԺ
½ðÅƽ²Ê¦£¬ARM ATCÊÚȨÅàѵ½²Ê¦¡£
ºÜ
¶àLINUX³õѧÕßÔÚѧϰlinuxͼÐη½ÃæµÄ֪ʶʱ»áÓöµ½Ò»Ð©¸ÅÄÈ磺X¡¢X11¡¢Xfree86¡¢WM¡¢KDE¡¢GNOME¡¢QT¡¢QT/E¡¢
Qtopia¡¢DirectFB¡¢Framebuffer¡¢ÏÔ¿¨¼ÓËÙÇý¶¯µÈµÈ¡£Àí½âËüÃÇÖ ......