uipc_mqueue.c (add14c83aa3f400b7de8d8dfc9f2df5ba18fa7c2) | uipc_mqueue.c (ae44bb014612f46a12d300be82381d2e16386fb8) |
---|---|
1/*- 2 * Copyright (c) 2005 David Xu <davidxu@freebsd.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 2228 unchanged lines hidden (view full) --- 2237 2238 if (uap->attr != NULL) { 2239 error = copyin(uap->attr, &attr, sizeof(attr)); 2240 if (error != 0) 2241 return (error); 2242 } 2243 error = kern_kmq_setattr(td, uap->mqd, uap->attr != NULL ? &attr : NULL, 2244 &oattr); | 1/*- 2 * Copyright (c) 2005 David Xu <davidxu@freebsd.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 2228 unchanged lines hidden (view full) --- 2237 2238 if (uap->attr != NULL) { 2239 error = copyin(uap->attr, &attr, sizeof(attr)); 2240 if (error != 0) 2241 return (error); 2242 } 2243 error = kern_kmq_setattr(td, uap->mqd, uap->attr != NULL ? &attr : NULL, 2244 &oattr); |
2245 if (error != 0) 2246 return (error); 2247 if (uap->oattr != NULL) | 2245 if (error == 0 && uap->oattr != NULL) { 2246 bzero(oattr.__reserved, sizeof(oattr.__reserved)); |
2248 error = copyout(&oattr, uap->oattr, sizeof(oattr)); | 2247 error = copyout(&oattr, uap->oattr, sizeof(oattr)); |
2248 } |
|
2249 return (error); 2250} 2251 2252int 2253sys_kmq_timedreceive(struct thread *td, struct kmq_timedreceive_args *uap) 2254{ 2255 struct mqueue *mq; 2256 struct file *fp; --- 497 unchanged lines hidden (view full) --- 2754 if (uap->attr != NULL) { 2755 error = copyin(uap->attr, &attr32, sizeof(attr32)); 2756 if (error != 0) 2757 return (error); 2758 mq_attr_from32(&attr32, &attr); 2759 } 2760 error = kern_kmq_setattr(td, uap->mqd, uap->attr != NULL ? &attr : NULL, 2761 &oattr); | 2249 return (error); 2250} 2251 2252int 2253sys_kmq_timedreceive(struct thread *td, struct kmq_timedreceive_args *uap) 2254{ 2255 struct mqueue *mq; 2256 struct file *fp; --- 497 unchanged lines hidden (view full) --- 2754 if (uap->attr != NULL) { 2755 error = copyin(uap->attr, &attr32, sizeof(attr32)); 2756 if (error != 0) 2757 return (error); 2758 mq_attr_from32(&attr32, &attr); 2759 } 2760 error = kern_kmq_setattr(td, uap->mqd, uap->attr != NULL ? &attr : NULL, 2761 &oattr); |
2762 if (error != 0) 2763 return (error); 2764 if (uap->oattr != NULL) { | 2762 if (error == 0 && uap->oattr != NULL) { |
2765 mq_attr_to32(&oattr, &oattr32); | 2763 mq_attr_to32(&oattr, &oattr32); |
2764 bzero(oattr32.__reserved, sizeof(oattr32.__reserved)); |
|
2766 error = copyout(&oattr32, uap->oattr, sizeof(oattr32)); 2767 } 2768 return (error); 2769} 2770 2771int 2772freebsd32_kmq_timedsend(struct thread *td, 2773 struct freebsd32_kmq_timedsend_args *uap) --- 146 unchanged lines hidden --- | 2765 error = copyout(&oattr32, uap->oattr, sizeof(oattr32)); 2766 } 2767 return (error); 2768} 2769 2770int 2771freebsd32_kmq_timedsend(struct thread *td, 2772 struct freebsd32_kmq_timedsend_args *uap) --- 146 unchanged lines hidden --- |