[Mplayer-cvslog] CVS: mpg12play/util shmem.c,1.1.1.1,1.2

Gernot Ziegler madmac at users.sourceforge.net
Thu May 24 15:54:52 CEST 2001


Update of /cvsroot/mplayer/mpg12play/util
In directory usw-pr-cvs1:/tmp/cvs-serv8628/util

Modified Files:
	shmem.c 
Log Message:
Compiling version

Index: shmem.c
===================================================================
RCS file: /cvsroot/mplayer/mpg12play/util/shmem.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** shmem.c	2001/05/15 01:21:21	1.1.1.1
--- shmem.c	2001/05/24 13:54:50	1.2
***************
*** 40,47 ****
--- 40,52 ----
    switch(shmem_type){
    case 0:  // ========= MAP_ANON|MAP_SHARED ==========
+ #ifdef MAP_ANON
      p=mmap(0,size,PROT_READ|PROT_WRITE,MAP_ANON|MAP_SHARED,-1,0);
      if(p==MAP_FAILED) break; // failed
      printf("shmem: %d bytes allocated using mmap anon\n",size);
      return p;
+ #else
+     printf("shmem: mmap anon is NOT AVAILABLE ON IRIX !\n",size);
+     break;
+ #endif
    case 1:  // ========= MAP_SHARED + /dev/zero ==========
  	  if ((devzero = open("/dev/zero", O_RDWR, 0)) == -1) break;
***************
*** 54,67 ****
      int shmemid;
      if ((shmemid = shmget(IPC_PRIVATE, size, IPC_CREAT | 0600)) == -1) break;
!     if ((int)(p = shmat(shmemid, 0, 0)) == -1){
!       perror ("shmat()");
!       shmctl (shmemid, IPC_RMID, &shmemds);
!       break;
!     }
!     if (shmctl(shmemid, IPC_RMID, &shmemds) == -1) {
!       perror ("shmctl()");
!       if (shmdt(p) == -1) perror ("shmdt()");
!       break;
!     }
      printf("shmem: %d bytes allocated using shmget() & shmat()\n",size);
      return p;
--- 59,74 ----
      int shmemid;
      if ((shmemid = shmget(IPC_PRIVATE, size, IPC_CREAT | 0600)) == -1) break;
!     if ((int)(p = shmat(shmemid, 0, 0)) == -1)
!       {
! 	perror ("shmat()");
! 	shmctl (shmemid, IPC_RMID, &shmemds);
! 	break;
!       }
!     if (shmctl(shmemid, IPC_RMID, &shmemds) == -1) 
!       {
! 	perror ("shmctl()");
! 	if (shmdt(p) == -1) perror ("shmdt()");
! 	break;
!       }
      printf("shmem: %d bytes allocated using shmget() & shmat()\n",size);
      return p;


_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog at lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog



More information about the MPlayer-cvslog mailing list