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

linux¹²ÏíÄÚ´æÊ¹ÓÃʵÀý

Èý¸öÎļþ£¬Ò»¸öÍ·Îļþ£¬Ò»¸ö¶Á£¬Ò»¸öд£¬ÓÃͬһ¸ökeyÖµÉêÇë¹²ÏíÄÚ´æ¡£
//shm.h
#ifndef _SHM_COM_H
#define _SHM_COM_H 1
#define TEXT_SZ 2048
struct shared_use_at
{
    int written_by_you;
    char some_text[TEXT_SZ];
};
struct kts
{
 int power;
 int mode;
 int temp;
 int windspeed;
 int write_flag;
};
#endif
//shm_write.c
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include "shm.h"
int main()
{
 int running = 1;
 void *shared_memory = (void *)0;
 struct shared_use_at *shared_stuff;
 char buffer[BUFSIZ];
 int shmid;
    shmid = shmget((key_t)1234, sizeof(struct shared_use_at), 0666 | IPC_CREAT);
    if(shmid == -1)
    {
 fprintf(stderr, "shmget failed\n");
 exit(EXIT_FAILURE);
    }
    shared_memory = shmat(shmid, (void *)0, 0);
    if(shared_memory == (void *)-1)
    {
        fprintf(stderr, "shmat failed\n");
        exit(EXIT_FAILURE);
    }
    printf("Memory attached at %X\n", (int)shared_memory);
    shared_stuff = (struct shared_use_at *)shared_memory;
    while(running)
    {
        while(shared_stuff->written_by_you == 1)
        {
            sleep(1);
            printf("waiting for client...\n");
        }
        printf("Enter some text: ");
      &n


Ïà¹ØÎĵµ£º

Èý¿î Linux ϵÄÃâ·Ñ×ÀÃæ¼¶É±¶¾Èí¼þ(ͼ)


ÓÉÓÚ Linux Á¼ºÃµÄÓû§È¨ÏÞ¹ÜÀíÌåϵ£¬²¡¶¾ÍùÍùÊÇ Linux ϵͳ¹ÜÀíÔ±×îºó²ÅÐèÒª¿¼ÂǵÄÎÊÌâ¡£ÒÔÍù£¬Linux ÉϵÄɱ¶¾Èí¼þÖ÷ÒªÊÇΪÆóÒµµÄÓʼþºÍÎļþ·þÎñÆ÷ËùÉè¼ÆµÄ¡£Èç½ñ£¬Ëæ×Å Linux ×ÀÃæÓû§ÊýÁ¿µÄÔö³¤£¬×ÀÃæÓû§ÔÚÊÜÒæÓÚ Linux ϵͳ¶Ô²¡¶¾½ÏÇ¿µÄÌìÈ»ÃâÒßÁ¦µÄͬʱ£¬Ò²ÐèҪɱ¶¾Èí¼þÇåÀí´ÓÍøÂç»òUÅÌ´øÀ´µÄWIndows²¡¶¾¡£¾¡¹ÜÄÇЩ ......

linuxÏÂi386,i486,i586,i686µÄÇø±ð


linuxÏÂi386,i486,i586,i686µÄÇø±ð
.
i386,i486,i586·Ö±ðÊÇÕë¶Ô80386,80486,80586±àÒëµÄ°ü£¬i686¾Í±È½Ï¹ã·ºÁË£¬´Óp2¿ªÊ¼x86´¦ÀíÆ÷¾Í½øÈëÁËp6¹¹¼ÜµÄʱ´ú£¬Ò»Ö±µ½ÏÖÔÚ¶¼ÊÇp6¼Ü¹¹¡£Ð¼ܹ¹µÄcpuÏòϼæÈÝΪ¾É¼Ü¹¹±àÒëµÄÈí¼þ°ü.
i386.rpmÓëi686.rpmÓÐÊ²Ã´Çø±ð?
x86Ìåϵ½á¹¹ËäȻָÁî¶¼Ò»Ñù£¬µ«ÊDz»Í¬Ê±´úµÄ¾ßÌåʵÏÖ£¬ÔÚ±àÒëÓ ......

LinuxÏÂMysql ÃüÁîÐÐÏÔʾÂÒÂëÎÊÌâ½â¾ö

ÔÚʹÓÃWindowsÃüÁîÐвÙ×÷MySQLÊý¾Ý¿âµÄʱºò£¬ÒÔutf8¸ñʽ´æ´¢ÔÚMySQLÊý¾Ý¿âÖеÄÊý¾Ý£¬´ÓÃüÁîÐжÁÈ¡³öÀ´×ÜÊÇÂÒÂ룬ÏÔʾȫÊÇÎʺš£»òÕß´ÓÃüÁîÐвåÈëÐÂÊý¾Ý£¬½á¹ûÏà·´£¬ÔÚÃüÁîÐÐÖÐÏÔʾÊÇÕý³£µÄ£¬µ«ÊÇÔÚPHPMyAdminÖÐÈ´ÊÇÂÒÂë¡£
¡¡¡¡¾­¹ýÉÏÍø²éÕÒÑо¿£¬·¢ÏÖmysqlµÄÃüÁîÐпͻ§¶Ë¸ù±¾ÎÞ·¨ÒÔutf-8µÄÐÎʽ·µ»ØÊý¾Ý£¬½â¾öÈçÏ¡£
¡¡¡¡² ......

»ñÈ¡linux½ø³ÌµÄÖ´ÐÐÎļþ·¾¶

ƽʱһ°ãÓÃpsÀ´²é¿´½ø³ÌÐÅÏ¢£¬¸Ï½ô¾Í¹»ÁË¡£½ñÌìÐèÒªÖªµÀÏêϸµÄ·¾¶£¬Ò»Ê±»¹Ïë²»ÆðÀ´¡£¼ÇµÃÓиö²ÎÊý£¬¿ÉÒԸıäpsµÄÊä³öÀïÃæcmdµÄÏÔʾ¿í¶È£¬¿Éϧ¼Ç²»ÇåÁË¡£»ØÍ·ÔÙÕÒÕÒ¡£
http://www.svn8.com/linux/glpz/20100221/22543.html
Õâ¸öÉÏÃæ½éÉܵķ½·¨ÊǸù¾ÝpidÔÚ/proc/pid_number ÏÂÃæ²é¿´¾ßÌåÐÅÏ¢¡£¾ÍÊÇÓеãСÂé·³¡£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ