1 /* $OpenBSD: arc4random_win.h,v 1.2 2014/07/19 00:08:43 deraadt Exp $ */ 2 3 /* 4 * Copyright (c) 1996, David Mazieres <dm@uun.org> 5 * Copyright (c) 2008, Damien Miller <djm@openbsd.org> 6 * Copyright (c) 2013, Markus Friedl <markus@openbsd.org> 7 * 8 * Permission to use, copy, modify, and distribute this software for any 9 * purpose with or without fee is hereby granted, provided that the above 10 * copyright notice and this permission notice appear in all copies. 11 * 12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 13 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 14 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 15 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 16 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 17 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 18 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 19 */ 20 21 /* 22 * Stub functions for portability. 23 */ 24 25 static inline int 26 _rs_allocate(struct _rs **rsp, struct _rsx **rsxp) 27 { 28 *rsp = calloc(1, sizeof(**rsp)); 29 if (*rsp == NULL) 30 return (-1); 31 32 *rsxp = calloc(1, sizeof(**rsxp)); 33 if (*rsxp == NULL) { 34 free(*rsp); 35 return (-1); 36 } 37 return (0); 38 } 39 40 static inline void 41 _rs_forkhandler(void) 42 { 43 } 44 45 static inline void 46 _rs_forkdetect(void) 47 { 48 } 49