sysv_msg.c (30994) | sysv_msg.c (34961) |
---|---|
1/* $Id: sysv_msg.c,v 1.16 1997/08/02 14:31:37 bde Exp $ */ | 1/* $Id: sysv_msg.c,v 1.17 1997/11/06 19:29:24 phk Exp $ */ |
2 3/* 4 * Implementation of SVID messages 5 * 6 * Author: Daniel Boulet 7 * 8 * Copyright 1993 Daniel Boulet and RTMX Inc. 9 * --- 257 unchanged lines hidden (view full) --- 267#endif 268 return(EINVAL); /* non-standard errno! */ 269 } 270 msqptr->msg_perm.uid = msqbuf.msg_perm.uid; /* change the owner */ 271 msqptr->msg_perm.gid = msqbuf.msg_perm.gid; /* change the owner */ 272 msqptr->msg_perm.mode = (msqptr->msg_perm.mode & ~0777) | 273 (msqbuf.msg_perm.mode & 0777); 274 msqptr->msg_qbytes = msqbuf.msg_qbytes; | 2 3/* 4 * Implementation of SVID messages 5 * 6 * Author: Daniel Boulet 7 * 8 * Copyright 1993 Daniel Boulet and RTMX Inc. 9 * --- 257 unchanged lines hidden (view full) --- 267#endif 268 return(EINVAL); /* non-standard errno! */ 269 } 270 msqptr->msg_perm.uid = msqbuf.msg_perm.uid; /* change the owner */ 271 msqptr->msg_perm.gid = msqbuf.msg_perm.gid; /* change the owner */ 272 msqptr->msg_perm.mode = (msqptr->msg_perm.mode & ~0777) | 273 (msqbuf.msg_perm.mode & 0777); 274 msqptr->msg_qbytes = msqbuf.msg_qbytes; |
275 msqptr->msg_ctime = time.tv_sec; | 275 msqptr->msg_ctime = time_second; |
276 break; 277 278 case IPC_STAT: 279 if ((eval = ipcperm(cred, &msqptr->msg_perm, IPC_R))) { 280#ifdef MSG_DEBUG_OK 281 printf("requester doesn't have read access\n"); 282#endif 283 return(eval); --- 101 unchanged lines hidden (view full) --- 385 msqptr->msg_last = NULL; 386 msqptr->msg_cbytes = 0; 387 msqptr->msg_qnum = 0; 388 msqptr->msg_qbytes = msginfo.msgmnb; 389 msqptr->msg_lspid = 0; 390 msqptr->msg_lrpid = 0; 391 msqptr->msg_stime = 0; 392 msqptr->msg_rtime = 0; | 276 break; 277 278 case IPC_STAT: 279 if ((eval = ipcperm(cred, &msqptr->msg_perm, IPC_R))) { 280#ifdef MSG_DEBUG_OK 281 printf("requester doesn't have read access\n"); 282#endif 283 return(eval); --- 101 unchanged lines hidden (view full) --- 385 msqptr->msg_last = NULL; 386 msqptr->msg_cbytes = 0; 387 msqptr->msg_qnum = 0; 388 msqptr->msg_qbytes = msginfo.msgmnb; 389 msqptr->msg_lspid = 0; 390 msqptr->msg_lrpid = 0; 391 msqptr->msg_stime = 0; 392 msqptr->msg_rtime = 0; |
393 msqptr->msg_ctime = time.tv_sec; | 393 msqptr->msg_ctime = time_second; |
394 } else { 395#ifdef MSG_DEBUG_OK 396 printf("didn't find it and wasn't asked to create it\n"); 397#endif 398 return(ENOENT); 399 } 400 401found: --- 325 unchanged lines hidden (view full) --- 727 msqptr->msg_last->msg_next = msghdr; 728 msqptr->msg_last = msghdr; 729 } 730 msqptr->msg_last->msg_next = NULL; 731 732 msqptr->msg_cbytes += msghdr->msg_ts; 733 msqptr->msg_qnum++; 734 msqptr->msg_lspid = p->p_pid; | 394 } else { 395#ifdef MSG_DEBUG_OK 396 printf("didn't find it and wasn't asked to create it\n"); 397#endif 398 return(ENOENT); 399 } 400 401found: --- 325 unchanged lines hidden (view full) --- 727 msqptr->msg_last->msg_next = msghdr; 728 msqptr->msg_last = msghdr; 729 } 730 msqptr->msg_last->msg_next = NULL; 731 732 msqptr->msg_cbytes += msghdr->msg_ts; 733 msqptr->msg_qnum++; 734 msqptr->msg_lspid = p->p_pid; |
735 msqptr->msg_stime = time.tv_sec; | 735 msqptr->msg_stime = time_second; |
736 737 wakeup((caddr_t)msqptr); 738 p->p_retval[0] = 0; 739 return(0); 740} 741 742#ifndef _SYS_SYSPROTO_H_ 743struct msgrcv_args { --- 205 unchanged lines hidden (view full) --- 949 * Return the message to the user. 950 * 951 * First, do the bookkeeping (before we risk being interrupted). 952 */ 953 954 msqptr->msg_cbytes -= msghdr->msg_ts; 955 msqptr->msg_qnum--; 956 msqptr->msg_lrpid = p->p_pid; | 736 737 wakeup((caddr_t)msqptr); 738 p->p_retval[0] = 0; 739 return(0); 740} 741 742#ifndef _SYS_SYSPROTO_H_ 743struct msgrcv_args { --- 205 unchanged lines hidden (view full) --- 949 * Return the message to the user. 950 * 951 * First, do the bookkeeping (before we risk being interrupted). 952 */ 953 954 msqptr->msg_cbytes -= msghdr->msg_ts; 955 msqptr->msg_qnum--; 956 msqptr->msg_lrpid = p->p_pid; |
957 msqptr->msg_rtime = time.tv_sec; | 957 msqptr->msg_rtime = time_second; |
958 959 /* 960 * Make msgsz the actual amount that we'll be returning. 961 * Note that this effectively truncates the message if it is too long 962 * (since msgsz is never increased). 963 */ 964 965#ifdef MSG_DEBUG_OK --- 62 unchanged lines hidden --- | 958 959 /* 960 * Make msgsz the actual amount that we'll be returning. 961 * Note that this effectively truncates the message if it is too long 962 * (since msgsz is never increased). 963 */ 964 965#ifdef MSG_DEBUG_OK --- 62 unchanged lines hidden --- |