search for: srandom

Displaying 20 results from an estimated 102 matches for "srandom".

Did you mean: random
2017 Jan 26
2
[PATCH v2 0/2] Fix srandom issues.
A better way to solve this I think. Rich.
2017 Jan 26
1
[PATCH] Use srandom (time (NULL) + getpid ()) throughout.
...e <error.h> #include <assert.h> #include <libintl.h> +#include <sys/types.h> #include <sys/time.h> #include <sys/stat.h> #include <utime.h> @@ -103,7 +104,7 @@ main (int argc, char *argv[]) textdomain (PACKAGE); /* We use random(3) below. */ - srandom (time (NULL)); + srandom (time (NULL) + getpid ()); enum { HELP_OPTION = CHAR_MAX + 1 }; diff --git a/fish/fish.c b/fish/fish.c index b7d63cf..52a9093 100644 --- a/fish/fish.c +++ b/fish/fish.c @@ -181,7 +181,7 @@ main (int argc, char *argv[]) textdomain (PACKAGE); /* We use random(...
1999 Sep 07
2
R-0.65.0 on mips-sgi-irix6.5: Error code 1 (bu21)
...I../include -I../../src/include -DHAVE_CONFIG_H -g -O2 -c S_compat.c -o S_compat.o In file included from ../include/S.h:47, from ../include/S_compat.h:28, from S_compat.c:28: /usr/local/lib/gcc-lib/mips-sgi-irix6.2/2.8.1/include/math.h:681: conflicting types for `srandom' /usr/include/stdlib.h:234: previous declaration of `srandom' /usr/local/lib/gcc-lib/mips-sgi-irix6.2/2.8.1/include/math.h:682: conflicting types for `initstate' /usr/include/stdlib.h:226: previous declaration of `initstate' /usr/local/lib/gcc-lib/mips-sgi-irix6.2/2.8.1/include/math...
2009 Jul 09
6
rdiscount Deadlock !
...---------------------- root@dcb0:/opt/gitorious# gem install rdiscount -v 1.3.1.1 Building native extensions. This could take a while... ERROR: Error installing rdiscount: ERROR: Failed to build gem native extension. /opt/ruby/bin/ruby extconf.rb checking for random()... yes checking for srandom()... yes checking for funopen()... no checking for fopencookie()... no extconf.rb:11: No funopen or fopencookie support available. (RuntimeError) ----------------------------------------------------------- so I have installed rdiscount-1.3.4 and rake db:migrate for gitorious wants rdiscount =...
2009 Aug 29
0
[LLVMdev] A create-distinct-item function with no (other) side effects
...Fri, Aug 28, 2009 at 5:56 PM, Kenneth Uildriks<kennethuil at gmail.com> wrote: > It would also > help optimize away calls to "random" in some cases. If you're talking about the Unix random(), it does has visible side effects, specifically related to the guarantee that an srandom call followed by N random() calls will always produce the same sequence of N numbers. -Eli
1999 Dec 06
1
nmbd won't run
...ait. I checked, and none are. It also mentioned something similar to the previous message, and suggested running nmbd as a daemon. 6. When I tried running nmbd as a daemon I got this message: cobra21# /opt/samba/bin/nmbd -D ld.so.1: /opt/samba/bin/nmbd: fatal: relocation error: symbol not found: srandom: referenced in /opt/samba/bin/nmbd Killed The man page for srandom implies that it is one of 3 system routines for generating random numbers but doesn't say what file it is in. I can't find ld.so.1 anywhere on the disk. (See #8) 7. With nmbd disabled or enabled in the inetd.conf file, smb...
2004 Jun 15
3
Repeat patch for ogg123
...= NULL; + opts->repeat = 1; } @@ -296,6 +297,7 @@ int items; struct stat stat_buf; int i; + int k; setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, LOCALEDIR); @@ -360,21 +362,6 @@ } else audio_buffer = NULL; - - /* Shuffle playlist */ - if (options.shuffle) { - int i; - - srandom(time(NULL)); - - for (i = 0; i < items; i++) { - int j = i + random() % (items - i); - char *temp = playlist_array[i]; - playlist_array[i] = playlist_array[j]; - playlist_array[j] = temp; - } - } - /* Setup signal handlers and callbacks */ ATEXIT (exit_cleanup); @@ -3...
2000 Jun 22
13
installing samba
Hi, I just downloaded the latest version of Samba in the form of samba-latest.tar.gz Managed to unzip it with gunzip but cannot figure out how to install it. Tried rpm but didn't work. I have an earlier version of Samba (2.0.6) on my SuSE 6.4 machine already. Can I just install the new version or do I need to do some sort of uninstall of the previous version first. advTHANKSance, Mariann
2020 Aug 11
3
[PATCH v3] virtio-rng: return available data with O_NONBLOCK
...tomic_t stop; > static void handler(int sig __attribute__((unused))) { stop = 1; } > > static void loop(int fd, int sec) > { > struct pollfd pfd = { .fd = fd, .events = POLLIN, }; > unsigned long errors = 0, eagains = 0, bytes = 0, succ = 0; > int size, rc, rd; > > srandom(getpid()); > if (CONDITION && fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_NONBLOCK) == -1) > perror("fcntl"); > size = MINBUFSIZ + random() % (MAXBUFSIZ - MINBUFSIZ + 1); > > for(;;) { > char buf[size]; > > if (stop) > break; > rc = poll...
2020 Aug 11
3
[PATCH v3] virtio-rng: return available data with O_NONBLOCK
...tomic_t stop; > static void handler(int sig __attribute__((unused))) { stop = 1; } > > static void loop(int fd, int sec) > { > struct pollfd pfd = { .fd = fd, .events = POLLIN, }; > unsigned long errors = 0, eagains = 0, bytes = 0, succ = 0; > int size, rc, rd; > > srandom(getpid()); > if (CONDITION && fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_NONBLOCK) == -1) > perror("fcntl"); > size = MINBUFSIZ + random() % (MAXBUFSIZ - MINBUFSIZ + 1); > > for(;;) { > char buf[size]; > > if (stop) > break; > rc = poll...
2011 Feb 27
4
[PATCH] Add minimal mkstemp(3) implementation.
...+++++++++++++++++++++++++ 3 files changed, 96 insertions(+), 1 deletions(-) create mode 100644 usr/klibc/mkstemp.c diff --git a/usr/include/stdlib.h b/usr/include/stdlib.h index 406f446..4706f71 100644 --- a/usr/include/stdlib.h +++ b/usr/include/stdlib.h @@ -79,6 +79,8 @@ static __inline__ void srandom(unsigned int __s) srand48(__s); } +__extern int mkstemp(char *); + /* Basic PTY functions. These only work if devpts is mounted! */ __extern int unlockpt(int); diff --git a/usr/klibc/Kbuild b/usr/klibc/Kbuild index af40367..62a3268 100644 --- a/usr/klibc/Kbuild +++ b/usr/klibc/Kbuild @@ -...
2015 Nov 22
2
Re: installation error
Thank you, The apt was set to look in the wheezy instead of the jessie one. > On 22 Nov 2015, at 13:30, Richard W.M. Jones <rjones@redhat.com> wrote: > > On Sat, Nov 21, 2015 at 05:12:19AM +0200, Keresztes Péter-Zoltán wrote: >> Hello, >> >> I am trying to install libguestfs on a proxmox (debian jessie with some custom packages) and when I run make at a certain
2016 Jan 06
0
[klibc:master] Remove obsolete getpt() function
...ibc/Kbuild | 2 +- usr/klibc/getpt.c | 16 ---------------- 3 files changed, 1 insertion(+), 18 deletions(-) diff --git a/usr/include/stdlib.h b/usr/include/stdlib.h index 856c647..c2d6264 100644 --- a/usr/include/stdlib.h +++ b/usr/include/stdlib.h @@ -83,7 +83,6 @@ static __inline__ void srandom(unsigned int __s) __extern int unlockpt(int); __extern char *ptsname(int); -__extern int getpt(void); __extern int posix_openpt(int); static __inline__ int grantpt(int __fd) diff --git a/usr/klibc/Kbuild b/usr/klibc/Kbuild index 7d95e87..5521038 100644 --- a/usr/klibc/Kbuild +++ b/usr/klibc...
2016 Jan 27
0
[klibc:master] Make posix_openpt() an inline
...ld | 2 +- usr/klibc/posix_openpt.c | 14 -------------- 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/usr/include/stdlib.h b/usr/include/stdlib.h index c2d6264..250755f 100644 --- a/usr/include/stdlib.h +++ b/usr/include/stdlib.h @@ -83,7 +83,14 @@ static __inline__ void srandom(unsigned int __s) __extern int unlockpt(int); __extern char *ptsname(int); -__extern int posix_openpt(int); + +static __inline__ int posix_openpt(int __mode) +{ + __extern int open(const char *, int, ...); + + __mode &= ~(O_CREAT | O_TMPFILE); + return open("/dev/ptmx", __mode); +...
2009 Aug 29
4
[LLVMdev] A create-distinct-item function with no (other) side effects
On Fri, Aug 28, 2009 at 3:47 PM, Nick Lewycky<nlewycky at google.com> wrote: > > > 2009/8/28 Kenneth Uildriks <kennethuil at gmail.com> >> >> This is by design, of course, (CreateDistinctItem does not return the >> same value given the same caller-visible global state) but I see no >> way to declare a function that: >> >> 1. Returns a
2004 Aug 06
0
one more try..
....1 1999/03/05 22:40:55 barath Exp $"; #endif extern char *getpass(); int main(argc, argv) int argc; char *argv[]; { static char saltChars[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./"; char salt[3]; char * plaintext; int i; if (argc < 2) { srandom(time(0)); /* may not be the BEST salt, but its close */ salt[0] = saltChars[random() % 64]; salt[1] = saltChars[random() % 64]; salt[2] = 0; } else { salt[0] = argv[1][0]; salt[1] = argv[1][1]; salt[2] = '\0'; if ((strchr(saltChars, salt[0]) == NULL) || (str...
2015 Nov 22
0
Re: installation error
...e the latest version of libguestfs: CC guestfish-edit.o CC guestfish-events.o CC guestfish-file-edit.o CC guestfish-fish.o fish.c: In function 'main': fish.c:173:3: warning: implicit declaration of function 'time' [-Wimplicit-function-declaration] srandom (time (NULL)); ^ fish.c:173:3: warning: nested extern declaration of 'time' [-Wnested-externs] fish.c: At top level: fish.c:649:14: warning: 'ps_restore' defined but not used [-Wunused-variable] static char *ps_restore = NULL; /* GUESTFISH_RESTORE */ ^ CC g...
2020 Aug 11
0
[PATCH v2] virtio-rng: return available data with O_NONBLOCK
...tomic_t stop; > static void handler(int sig __attribute__((unused))) { stop = 1; } > > static void loop(int fd, int sec) > { > struct pollfd pfd = { .fd = fd, .events = POLLIN, }; > unsigned long errors = 0, eagains = 0, bytes = 0, succ = 0; > int size, rc, rd; > > srandom(getpid()); > if (CONDITION && fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_NONBLOCK) == -1) > perror("fcntl"); > size = MINBUFSIZ + random() % (MAXBUFSIZ - MINBUFSIZ + 1); > > for(;;) { > char buf[size]; > > if (stop) > break; > rc = poll...
2020 Jul 21
0
[PATCH v9 72/84] KVM: introspection: add KVMI_VCPU_GET_MTRR_TYPE
...ype_reply rpl; + + req.cmd.gpa = test_gpa; + + test_vcpu0_command(vm, KVMI_VCPU_GET_MTRR_TYPE, + &req.hdr, sizeof(req), + &rpl, sizeof(rpl)); + + pr_info("mtrr_type: gpa 0x%lx type 0x%x\n", test_gpa, rpl.type); +} + static void test_introspection(struct kvm_vm *vm) { srandom(time(0)); @@ -1628,6 +1646,7 @@ static void test_introspection(struct kvm_vm *vm) test_event_xsetbv(vm); test_cmd_vcpu_get_xcr(vm); test_cmd_vcpu_xsave(vm); + test_cmd_vcpu_get_mtrr_type(vm); unhook_introspection(vm); } diff --git a/virt/kvm/introspection/kvmi_int.h b/virt/kvm/introspect...
2020 Aug 11
0
[PATCH v2] virtio-rng: return available data with O_NONBLOCK
...handler(int sig __attribute__((unused))) { stop = 1; } >> >> static void loop(int fd, int sec) >> { >> struct pollfd pfd = { .fd = fd, .events = POLLIN, }; >> unsigned long errors = 0, eagains = 0, bytes = 0, succ = 0; >> int size, rc, rd; >> >> srandom(getpid()); >> if (CONDITION && fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_NONBLOCK) == -1) >> perror("fcntl"); >> size = MINBUFSIZ + random() % (MAXBUFSIZ - MINBUFSIZ + 1); >> >> for(;;) { >> char buf[size]; >> >> if (stop) &...