::: °­ÁÂ/¼Ò½º/¹®¼­ :::

°­ÁÂ/¼Ò½º/¹®¼­ ¼º°Ý¿¡ ¸ÂÁö ¾Ê´Â ±¤°í,ºñ¹æ,Áú¹®ÀÇ ±ÛÀº Áï½Ã »èÁ¦Çϸç
³»¿ëÀ» º¹»çÇÏ¿© »ç¿ëÇÒ °æ¿ì ¹Ýµå½Ã ÀÌ°÷(http://www.howto.pe.kr)À» Ãâó·Î ¸í½ÃÇÏ¿© ÁÖ¼¼¿ä


Category

  ±è¿µ´ë(2003-03-17 02:38:25, Hit : 6389, Vote : 1603
 [System V IPC] msgget() function - ¸Þ¼¼ÁöÅ¥

/***************************************************
*   Creat  : 2001. 02. 10  (programed by Cori-Young)
*   Site: http://www.byoneself.co.kr
*   Update :
***************************************************/

#include <stdio.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/msg.h>

extern void  exit();
extern void  perror();

main()
{
        key_t  key;
        int  msgflg;        
        int  msqid;

        (void) fprintf(stderr, "All numeric input is expected to follow C conventions:n");
         (void) fprintf(stderr,  "t0x... is interpreted as hexadecimal,n");
        (void) fprintf(stderr, "t0... is interpreted as octal,n");
        (void) fprintf(stderr, "totherwise, decimal.n");
        (void) fprintf(stderr, "IPC_PRIVATE == %#lxn", IPC_PRIVATE);
        (void) fprintf(stderr, "Enter key: ");

        (void) scanf("%li", &key);

        (void) fprintf(stderr, "nExpected flags for msgflg argumentare:n");
        (void) fprintf(stderr, "tIPC_EXCL =t%#8.8on", IPC_EXCL);
        (void) fprintf(stderr, "tIPC_CREAT =t%#8.8on", IPC_CREAT);
        (void) fprintf(stderr, "towner read =t%#8.8on", 0400);
        (void) fprintf(stderr, "towner write =t%#8.8on", 0200);
        (void) fprintf(stderr, "tgroup read =t%#8.8on", 040);
        (void) fprintf(stderr, "tgroup write =t%#8.8on", 020);
        (void) fprintf(stderr, "tother read =t%#8.8on", 04);
        (void) fprintf(stderr, "tother write =t%#8.8on", 02);
        (void) fprintf(stderr, "Enter msgflg value: ");
        
        (void) scanf("%i", &msgflg);

        (void) fprintf(stderr, "nmsgget: Calling msgget(%#lx,%#o)n",        key, msgflg);
        
        if (msqid = msgget(key, msgflg|0666) == -1)
        {
                perror("msgget: msgget failed");
                exit(1);
        }
        else {
                (void) fprintf(stderr,"msgget: msgget succeeded: msqid = %dn", msqid);
                exit(0);
        }
}





62   [Unix/Linux] [°­ÁÂ] ÀÎÅÚ ¼¾Æ®¸®³ë ¹«¼±·£ Ä«µå: ndiswrapper  ±è¿µ´ë 2004/06/27 12555 2189
61   [Unix/Linux] [¼Ò½º] top for System V Release 4, Intel or Sparc CPU  ±è¿µ´ë 2004/02/20 11193 1300
60   [Unix/Linux] [¼Ò½º] top for SunOS 5.x (Solaris 2.x)  ±è¿µ´ë 2004/02/20 15462 1331
59   [Unix/Linux] [¼Ò½º] String Çؽ¬(hash) ÇÔ¼ö  ±è¿µ´ë 2003/07/29 8066 1591
58   [Unix/Linux] [°­ÁÂ] À¥·Î±×ºÐ¼®À» À§ÇÑ Webalizer + GDlib + PNGlib + Zlib ¼³Ä¡  ±è¿µ´ë 2003/05/04 8543 1517
57   [Unix/Linux] [°­ÁÂ] Apache + MySQL + PHP4 + Zend Optimizer ¼³Ä¡  ±è¿µ´ë 2003/04/15 8682 1630
56   [Unix/Linux] [System V IPC] shmop() function - °øÀ¯¸Þ¸ð¸®  ±è¿µ´ë 2003/03/17 6539 1584
55   [Unix/Linux] [System V IPC] shmctl() function - °øÀ¯¸Þ¸ð¸®  ±è¿µ´ë 2003/03/17 9912 1728
54   [Unix/Linux] [System V IPC] shmget() function - °øÀ¯¸Þ¸ð¸®  ±è¿µ´ë 2003/03/17 11232 1793
53   [Unix/Linux] [System V IPC] semop() function - ¼¼¸¶Æ÷¾î  ±è¿µ´ë 2003/03/17 5791 1439
52   [Unix/Linux] [System V IPC] semctl() function - ¼¼¸¶Æ÷¾î  ±è¿µ´ë 2003/03/17 6167 1412
51   [Unix/Linux] [System V IPC] semget() function - ¼¼¸¶Æ÷¾î  ±è¿µ´ë 2003/03/17 6720 1663
  [Unix/Linux] [System V IPC] msgget() function - ¸Þ¼¼ÁöÅ¥  ±è¿µ´ë 2003/03/17 6389 1603
49   [Unix/Linux] [System V IPC] msgctl() function - ¸Þ¼¼ÁöÅ¥  ±è¿µ´ë 2003/03/17 6495 1703
48   [Unix/Linux] [System V IPC] msgrcv() function - ¸Þ¼¼ÁöÅ¥  ±è¿µ´ë 2003/03/17 7559 1702
47   [Unix/Linux] [System V IPC] msgsnd() function - ¸Þ¼¼ÁöÅ¥  ±è¿µ´ë 2003/03/17 8364 1923
46   [Unix/Linux] [POSIX IPC] »ý»êÀÚ/¼ÒºñÀÚ - ¼¼¸¶Æ÷¾î  ±è¿µ´ë 2003/03/17 8195 5692
45   [Unix/Linux] [POSIX IPC] mq_receive() function - ¸Þ¼¼ÁöÅ¥  ±è¿µ´ë 2003/03/17 8280 1822
44   [Unix/Linux] [POSIX IPC] mq_send() function - ¸Þ¼¼ÁöÅ¥  ±è¿µ´ë 2003/03/17 12430 1713
43   [Unix/Linux] [Thread] pthread_cond() function  ±è¿µ´ë 2003/03/17 6655 1697

1 [2][3][4]
 

Copyright 1999-2024 Zeroboard / skin by zero