bsd Questions
4
I am unsure why these two blocks of code give different outputs:
unsigned int seed1 = 0;
char state1[256];
initstate(seed1, state1, 256);
printf("%10ld\n", random());
printf("%10ld\n", random());
...
2
Solved
I'm studying sys/queue.h from FreeBSD and I have one question:
In sys/queue.h, LIST_ENTRY is defined as follows:
#define LIST_ENTRY(type) \
struct { \
struct type *le_next; /* next element */ \
...
Sinuosity asked 8/5, 2013 at 12:23
4
I know nothing about Sed but need this command (which works fine on Ubuntu) to work on a Mac OSX:
sed -i "/ $domain .*#drupalpro/d" /etc/hosts
I'm getting:
sed: 1: "/etc/hosts": extra cha...
Hylton asked 25/5, 2013 at 3:3
1
Solved
1
Solved
I wanted to use DTrace to see "what syscalls are made by my shell script".
I made a very simple shell script, shell.sh, and gave it execute privileges:
#!/bin/bash
grep 1 <<< 123
I cd'...
5
Solved
How can I get the process details like name of application & real path of application from process id?
I am using Mac OS X.
Lindsley asked 22/9, 2011 at 8:30
2
1
Solved
Throughout the CoreFoundation framework source, POSIX filesystem API calls (e.g. open(), stat(), et al…) are wrapped in an idiom wherein a descriptor on /dev/autofs_nowait is acquired – with open(…...
Danieldaniela asked 9/9, 2016 at 4:18
1
Solved
How to run *BSD (Open, Free, etc.) on Docker?
I am using Docker for Mac.
But There is no BSD image on Docker Hub.
How I can run it?
3
Solved
I am trying to use the select function to have non-blocking i/o between a server and 1 client (no more) where the communication flows nicely (can send at any time and the other will receive without...
Silverstein asked 16/7, 2011 at 6:17
2
Solved
While working on a project that reads from /dev/urandom to generate random bytes, it was suggested that I check to make sure that /dev/urandom is a device not just a file.
The most straightforward...
Katheryn asked 25/7, 2015 at 20:58
1
Solved
Windows (NtQueryObject), Linux (/proc/self/fd/x) and OS X (F_GETPATH) all have methods for retrieving the path of a currently open file descriptor. Supposedly so does FreeBSD via something like the...
2
Solved
Given this sample input:
ID Sample1 Sample2 Sample3
One 10 0 5
Two 3 6 8
Three 3 4 7
I needed to produce this output using AWK:
ID Sample1 Sample2 Sample3
One 62.50 0.00 25.00
Two 18.75 60.0...
4
Solved
There are pages scattered around the web that describe POSIX AIO facilities in varying amounts of detail. None of them are terribly recent. It's not clear what, exactly, they're describing. For exa...
Sphygmic asked 17/9, 2008 at 21:32
2
Solved
I use the sed command on macOS with the following text:
$ cat pets.txt
This is my cat
my cat's name is betty
This is your dog
your dog's name is frank
This is your fish
your fish's name is geo...
1
Solved
I'm trying to concatenate a license to the top of my built sources. I'm use GNU Make. In one of my rules, I have:
cat src/license.txt build/3d-tags.js > build/3d-tags.js
But this seems to be ...
Selia asked 30/9, 2014 at 0:55
1
Solved
Can stdout file descriptor differ from 1 (STDOUT_FILENO) assuming stdout need not be a modifiable lvalue?
For example, can freopen("/dev/null", "w", stdout) change fileno(stdout) result?
2
Solved
I'm using this reference : sed help: matching and replacing a literal "\n" (not the newline)
and I have a file "test1.txt" that contains a string hello\ngoodbye
I use this command...
2
Solved
I saw some BSD code using the following construct:
typedef int driver_filter_t(void*);
What does that mean, exactly? I don't think it's a function pointer because otherwise it would be something...
4
Any one knows why BSD md5 program produces hash output in this format ...
MD5 (checksum.md5) = 9eb7a54d24dbf6a2eb9f7ce7a1853cd0
... while GNU md5sum produces much more sensible format like this?...
1
Solved
Non greedy matching as far as I know is not part of Basic Regular Expression (BRE) and Extended Regular Expression (ERE). However, the behaviour on different versions of grep (BSD and GNU) seems to...
2
Have been doing some google search and some reading on this subject but cannot seem to get it right no matter how much time i spent searching.
What i want to do is to receive broadcast message of...
4
Solved
For example, take open(2), which has the following synopsis:
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
int open(const char *pathname, int flags);
int open...
1
Solved
I am interested in iterating all mounted file systems on OSX (currently running 10.9 Mavericks). I am looking for something similar to getmntent() or the output of the mount shell command (although...
Residence asked 7/11, 2013 at 17:58
2
Solved
Linux's "man close" warns (SVr4, 4.3BSD, POSIX.1-2001):
Not checking the return value of close() is a common but nevertheless serious programming error. It is quite possible that errors on a pre...
© 2022 - 2025 — McMap. All rights reserved.