Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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


Ïà¹ØÎĵµ£º

Mysql´íÎ󼯽õ£¨Linux£©


 
1£º Can’t connect to [local] MySQL server´íÎó
Ò»¸öMySQL¿Í»§¿ÉÒÔÁ½ÖÖ²»Í¬µÄ·½Ê½Á¬½Ómysqld·þÎñÆ÷£ºUnixÌ×½Ó×Ö£¬Ëüͨ¹ýÔÚÎļþϵͳÖеÄÒ»¸öÎļþ(ȱʡ“/tmp /mysqld.sock”)½øÐÐÁ¬½Ó£»»òTCP/IP£¬Ëüͨ¹ýÒ»¸ö¶Ë¿ÚºÅÁ¬½Ó¡£UnixÌ×½Ó×Ö±ÈTCP/IP¸ü¿ì£¬µ«ÊÇÖ»ÓÐÓÃÔÚÁ¬½Óͬһ̨¼ÆËã»úÉϵķþÎñÆ÷¡£Èç¹ûÄ ......

Linux²é¿´°æ±¾

1.²é¿´Äں˰汾ÃüÁî
 1) cat /proc/version
 2) uname -a
 3) uname -r
2.²é¿´linuxµÄ°æ±¾
 1) lsb_release -a
 2) cat /etc/redhat-release
 3) cat /etc/issue
 4) rpm -q redhat-release (redhatϵͳ) ......

Ubuntu linuxϵͳϽ¨Á¢arm½»²æ±àÒëÆ÷

½â¾ö²½Ö裺ÒÔarm-linux-gcc-4.3.2.tgzΪÀý
1.       °Ñarm-linux-gcc-4.3.2.tgz¿½±´µ½ÄãÖ¸¶¨µÄĿ¼ÀȻºóÓÃtarÃüÁî½âѹµ½µ±Ç°Ä¿Â¼¡£³É¹¦ºó£¬»áÔÚ4.3.2/binÏÂÕÒµ½arm-linux-gcc¡£
ÀýÈ磺/opt/arm-linux-gcc-4.3.2.taz£¬ÒÔÏÂÃüÁºìɫΪϵͳÌáʾ·û£¬ºÚɫΪÓû§ÃüÁî
gylu@dell-desktop:~$ ......

Ubuntu linuxϵͳϰ²×°C kermit´®¿Ú¹¤¾ß

½â¾ö²½Ö裺
gylu@dell-desktop:~$ sudo apt-get install ckermit
ÏÔʾ°²×°¹ý³Ì
gylu@dell-desktop:~$gedit ~/.kermrc
ÊäÈëÏÂÃæÄÚÈݺ󱣴æ.kermrcÍ˳ö:
   set line            /dev/ttyS0
    set speed    & ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ