Linux ½ø³Ì´´½¨
×÷ÕߣºÀîÖÇÃô,»ªÇåÔ¶¼ûǶÈëʽѧԺÉϺ£·ÖÖÐÐĽ²Ê¦¡£
ÔÚ Linux ÄÚºËÄÚ£¬½ø³ÌÊÇÓÉÏ൱´óµÄÒ»¸ö³ÆΪ task_struct µÄ½á¹¹±íʾµÄ¡£´Ë½á¹¹°üº¬ËùÓбíʾ´Ë½ø³ÌËù±ØÐèµÄÊý¾Ý£¬´ËÍ⣬»¹°üº¬ÁË´óÁ¿µÄÆäËûÊý¾ÝÓÃÀ´Í³¼Æ£¨accounting£©ºÍά»¤ÓëÆäËû½ø³ÌµÄ¹Øϵ£¨¸¸ºÍ×Ó£©¡£ÏÂÃæ¸ø³öÁË task_struct µÄһС²¿·Ö¡£task_struct λÓÚ ./linux/include/linux/sched.h¡£
struct task_struct {
volatile long state;
void *stack;
unsigned int flags;
int prio, static_prio;
struct list_head tasks;
struct mm_struct *mm, *active_mm;
pid_t pid;
pid_t tgid;
struct task_struct *real_parent;
char comm[TASK_COMM_LEN];
struct thread_struct thread;
struct files_struct *files;
...
};
ÔÚtask_structÖУ¬¿ÉÒÔ¿´µ½¼¸¸öÔ¤ÁÏÖ®ÖеÄÏ±ÈÈçÖ´ÐеÄ״̬¡¢¶ÑÕ»¡¢Ò»×é±êÖ¾¡¢¸¸½ø³Ì¡¢Ö´ÐеÄỊ̈߳¨¿ÉÒÔÓкࣩܶÒÔ¼°¿ª·ÅÎļþ¡£¶ÔÆä×ö¼òµ¥ÉùÃ÷ÈçÏÂ
<1> state ±äÁ¿ÊÇһЩ±íÃ÷ÈÎÎñ״̬µÄ±ÈÌØλ¡£×î³£¼ûµÄ״̬ÓУº
1£®TASK_RUNNING ±íʾ½ø³ÌÕýÔÚÔËÐУ¬»òÊÇÅÅÔÚÔËÐжÓÁÐÖÐÕýÒªÔËÐÐ
2£®TASK_INTERRUPTIBLE ±íʾ½ø³ÌÕýÔÚÐÝÃß
3£®TASK_UNINTERRUPTIBLE ±íʾ½ø³ÌÕýÔÚÐÝÃßµ«²»ÄܽÐÐÑ
4£®TASK_STOPPED ±íʾ½ø³ÌÍ£Ö¹
×¢£ºÕâ
Ïà¹ØÎĵµ£º
configureÒ»°ãÊÇtar.gz°üÀïÃæµÄÒ»¸ö¿ÉÖ´ÐÐÎļþ£¬./configureÊÇÖ´ÐÐËü£¬Æä×÷ÓþÍÊǸù¾ÝϵͳÇé¿ö×Ô¶¯Éú³É±àÒëʱËùÐèµÄMakefileÎļþ¡£Linux»·¾³ÏµÄÈí¼þ°²×°£¬²¢²»ÊÇÒ»¼þÈÝÒ×µÄÊÂÇ飻Èç¹ûͨ¹ýÔ´´úÂë±àÒëºóÔÚ°²×°£¬µ±È»ÊÂÇé¾Í¸üΪ¸´ÔÓһЩ£»ÏÖÔÚ°²×°¸÷ÖÖÈí¼þµÄ½Ì³Ì¶¼·Ç³£Æձ飻µ«Íò±ä²» ÀëÆäÖУ¬¶Ô»ù´ ......
1. ³õʼ»¯Ò»¸öÁ¬½Ó¾ä±ú
MYSQL *mysql_init(MYSQL *);
ÕýÈ·£º·µ»ØÒ»¸öÖ¸ÏòзÖÅäµÄÁ´½Ó¾ä±ú½á¹¹µÄÖ¸Õë
´íÎó£ºNULL
×¢£º¸Ãº¯ÊýµÄ´«Èë²ÎÊýͨ³£ÎªNULL¼´¿É¡£
2. ½¨Á¢ÎïÀíÁ¬½Ó
MYSQL *mysql_real_connect(MYSQL *connect ......
ÂÜÀòÊÀ½ç ¸úÄúÒ»Æð¿´ÊÀ½ç http://lolier.info/ A£ºRPM°ü£¬ÕâÖÖÈí¼þ°ü¾ÍÏñwindowsµÄEXE°²×°ÎļþÒ»Ñù£¬¸÷ÖÖÎļþÒѾ±àÒëºÃ£¬²¢´òÁË°ü£¬ÄĸöÎļþ¸Ã·Åµ½ÄĸöÎļþ¼Ð£¬¶¼Ö¸¶¨ºÃÁË£¬°²×°·Ç³£·½±ã£¬ÔÚͼÐνçÃæÀïÄãÖ»ÐèҪ˫»÷¾ÍÄÜ×Ô¶¯°²×°¡£ ==ÈçºÎжÔØ: 1¡¢´ò¿ªÒ»¸öSHELLÖÕ¶Ë 2¡¢ÒòΪLINUXϵÄÈí¼þÃû¶¼°üÀ¨°æ±¾ºÅ£¬ËùÒÔжÔØÇ°×îºÃÏÈ ......
Ï̳߳Ø
£º¼òµ¥µØ˵£¬Ï̳߳Ø
¾ÍÊÇÔ¤ÏÈ´´½¨ºÃÒ»ÅúỊ̈߳¬·½±ã¡¢¿ìËٵش¦ÀíÊÕµ½µÄÒµÎñ¡£±ÈÆð´«Í³µÄµ½À´Ò»¸öÈÎÎñ£¬¼´Ê±´´½¨Ò»¸öÏß³ÌÀ´´¦Àí£¬½ÚÊ¡ÁËÏ̵߳Ĵ´½¨ºÍ»ØÊյĿªÏú£¬ÏìÓ¦¸ü¿ì£¬Ð§ÂÊ
¸ü¸ß¡£
ÔÚlinuxÖУ¬Ê¹ÓõÄÊÇposixÏ߳̿⣬Ê×ÏȽéÉܼ¸¸ö³£Óõĺ¯Êý£º
1 Ï̵߳Ĵ´½¨ºÍÈ¡Ïûº¯Êý
pthread_create
´´½¨
pthread_join
......
Q. How can I add a user to a group under Linux operating system?
A. You can use useradd or usermod commands to add a user to a group. useradd command creates a new user or update default new user information. usermod command modifies a user account i.e. it is useful to add user to existin ......