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

Linux c Êý¾ÝÀàÐÍ

µ±LinuxÄÚºËÔÚÌåϵ½á¹¹²îÒì½Ï´óµÄƽ̨֮¼äÒÆֲʱ£¬»á²úÉúÓëÊý¾ÝÀàÐÍÏà¹ØµÄÎÊÌâ¡£
.ÔÚ±àÒëÄÚºËʱʹÓà -Wall  -W strict-prototypes Ñ¡Ïî, ¿ÉÒÔ±ÜÃâºÜ¶à´íÎóµÄ·¢Éú
.ÄÚºËʹÓõĻù±¾Êý¾ÝÀàÐÍÖ÷ÒªÓÐ:
     int           ±ê×¼CÓïÑÔÕûÊýÀàÐÍ
     u32         32λÕûÊýÀàÐÍ
     pid_t       Ìض¨Äں˶ÔÏópidµÄÀàÐÍ
.ÔÚ²»Í¬µÄCPUÌåϵ½á¹¹ÉÏ£¬CÓïÑÔµÄÊý¾ÝÀàÐÍËùÕ¼¿Õ¼ä²»Ò»Ñù¡£
 
arch 
char 
 short
int 
long 
ptr 
long-long 
u8 
u16 
u32 
u64 
i686


 4
 4
 4



4

i386 

2
4
4
4
8
1
2
4
8
alpha 

2
4
8
8
8
1
2
4
8
armv41 
1
2
4
4
4
8
1
2
4
8
 ia64
1
2
4
8
8
8
1
2
4
8
 m68k
1
2
4
4
4
8
1
2
4
8
mips
1
2
4
4
4
8
1
2
4
8
ppc
1
2
4
4
4
8
1
2
4
8
sparc
1
2
4
4
4
8
1
2
4
8
sparc64
1
2
4
4
4
8
1
2
4
8
.ÄÚºËÖеĵØÖ·ÊÇunsigned longÀàÐÍ£¬ Ö¸Õë´óСºÍlongÀàÐÍÏàͬ
.ÄÚºËÌṩÏÂÁÐÊý¾ÝÀàÐÍ£¬ ËùÓÐÀàÐÍÔÚÍ·Îļþ<asm/types.h>ÖÐÉùÃ÷£¬ Õâ¸öÎļþÓÖ±»Í·Îļþ<Linux/types.h>Ëù°üº¬£¬ ÏÂÃæÊÇ include/asm/typs.hÎļþ
[File] /usr/src/kernels/2.6.9-22.EL-i686/include/asm-i386/types.h
#ifndef _I386_TYPES_H
#define _I386_TYPES_H
#ifndef __ASSEMBLY__
typedef unsigned short umode_t;
/*
 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
 * header files exported to user space
 */
typedef __signed__ char __s8;
typedef unsigned char __u8;
typedef __signed__ short __s16;
typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
typedef __sig


Ïà¹ØÎĵµ£º

Redhat Linux IPµØÖ·ÅäÖñʼÇ

ÔÚÃüÁîģʽÏÂÉèÖÃIPµØÖ·£¬ÓÐÁ½ÖÖ·½Ê½£¬Ò»ÖÖÊDZ¾´Î¿ª»úÓÐЧ£¬¼´Ê¹ÓÃifconfig eth0 IP netmask µÄ·½Ê½£¬ÏµÍ³Ò»µ©¹Ø»úÖØÆôÐèÒªÖØÐÂÉèÖÃIP£»ÁíÒ»ÖÖÖ±½Ó¸ü¸ÄÅäÖÃÎļþ¡£ÔÚÕâÀï²ÉÓÃÖ±½ÓÐÞ¸ÄÅäÖÃÎļþµÄ·½Ê½½øÐÐÉèÖÃIP¡£
 
LINUX IPÅäÖÃÎļþΪifcfg-eth0£¬¸ÃÎļþ´æ·ÅÔÚ/etc/sysconfig/network-scripts·¾¶Ï£¬
 
²ÉÓÃV ......

linux½ø³ÌÖ®¼äµÄͨÐÅ

¸¸×Ó½ø³ÌÈçºÎͨÐÅ£¿
Ò»¶Ô¸¸×Ó½ø³Ì¿ÉÒÔͨ¹ýÕý³£µÄ½ø³Ì¼äͨÐŵİ취(¹ÜµÀ£¬Ì×½Ó×Ö£¬ÏûÏ¢¶ÓÁУ¬¹²ÏíÄÚ´æ)½øÐÐͨÐÅ£¬µ«Ò²¿ÉÒÔͨ¹ýÀûÓÃËüÃÇ×÷Ϊ¸¸×Ó½ø³ÌµÄÏ໥¹Øϵ¶ø¾ßÓеÄһЩÌØÊâ·½·¨¡£
Ò»¸ö×îÏÔÈ»µÄ·½·¨ÊǸ¸½ø³Ì¿ÉÒԵõ½×Ó½ø³ÌµÄÍ˳ö״̬¡£
ÒòΪ×Ó½ø³Ì´ÓËüµÄ¸¸½ø³Ì¼Ì³ÐÎļþÃèÊö·û£¬ËùÒÔ¸¸½ø³Ì¿ÉÒÔ´ò¿ªÒ»¸ö¹ÜµÀµÄÁ½¶Ë£¬È» ......

½âÎöLinux²Ù×÷ϵͳ½©Ê¬½ø³Ì

ÔÚfork()/execve()¹ý³ÌÖУ¬¼ÙÉè×Ó½ø³Ì½áÊøʱ¸¸½ø³ÌÈÔ´æÔÚ£¬¶ø¸¸½ø³Ìfork()֮ǰ¼Èû°²×°SIGCHLDÐźŴ¦Àíº¯Êýµ÷ÓÃwaitpid()µÈ´ý×Ó½ø³Ì½áÊø£¬ÓÖûÓÐÏÔʽºöÂÔ¸ÃÐźţ¬Ôò×Ó½ø³Ì³ÉΪ½©Ê¬½ø³Ì£¬ÎÞ·¨Õý³£½áÊø£¬´Ëʱ¼´Ê¹ÊÇrootÉí·Ýkill-9Ò²²»ÄÜɱËÀ½©Ê¬½ø³Ì¡£²¹¾È°ì·¨ÊÇɱËÀ½©Ê¬½ø³ÌµÄ¸¸½ø³Ì(½©Ê¬½ø³ÌµÄ¸¸½ø³Ì±ØÈ»´æÔÚ)£¬½©Ê¬½ø³Ì³ÉÎ ......

ÈçºÎÖÕÖ¹Ï̵߳ÄÔËÐУ¨C/C++£©

ÈçºÎÖÕÖ¹Ï̵߳ÄÔËÐУ¨C/C++£©
ÏëÒªÖÕÖ¹Ï̵߳ÄÔËÐУ¬¿ÉÒÔʹÓÃÒÔÏ·½·¨£º
1¡¢Ï̺߳¯Êý·µ»Ø£¨×îºÃʹÓø÷½·¨£©¡£
2¡¢Í¨¹ýµ÷ÓÃExitThreadº¯Êý£¬Ï߳̽«×ÔÐг·Ïû£¨×îºÃ²»Ê¹Óø÷½·¨£©¡£
3¡¢Í¬Ò»¸ö½ø³Ì»òÁíÒ»¸ö½ø³ÌÖеÄÏ̵߳÷ÓÃTerminateThreadº¯Êý£¨Ó¦±ÜÃâʹÓø÷½·¨£©¡£
4¡¢ExitProcessºÍTerminateProcessº¯ÊýÒ²¿ÉÒÔÓÃÀ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ