BSD is a family of Unix-like operating systems, including FreeBSD, NetBSD and OpenBSD.
Questions tagged [bsd]
510 questions
0
votes
6 answers
Linked Lists example - Why are they used?
I was looking at a code block on how to get interface information for Unix / iOS / Mac OS X (IP address, interface names, etc.), and wanted to understand more of why linked lists are used. I'm not a full-time programmer, but I can code and always…

Jeff Coe
- 482
- 3
- 18
0
votes
1 answer
TFTP UDP header checksum failure
I have a codebase in C that parses network packets, and it seems to work with UDP just fine. Except for (the first packet of) TFTP. Is the Ubuntu tftp client (which is actually the BSD netkit TFTP client) faulty in this respect? I have noticed, for…

KJH
- 375
- 2
- 10
0
votes
0 answers
Error in writing own system call: incompatible type for argument 2 of `copyout'
I am writing my own system call in openBSD. I am trying to use the copyout function which has the signature :
int
copyout(void *kaddr, void *uaddr, size_t len);
I have an array
char word[MAX_STR_LENGTH+1];
I also have a struct
struct…

user2871354
- 530
- 1
- 5
- 15
0
votes
1 answer
BSD grep returning incorrect results
When executing grep on OSX my results are incorrect. I'm looking for the offset of a substring with several matches, using -aob. 'a' indicating that i'm using strings, 'o' only showing the result, and 'b' for the byte offset.
echo "ABDABCABC" | grep…

Holderdash
- 85
- 1
- 5
0
votes
0 answers
Interrupt handling on kernel thread with NetBSD kernel backtrace on MIPS
I encountered a NetBSD 5 kernel crash running on MIPS.
From panic string it looks like we were stuck in a kernel thread and could never come out of it.
Functions in the stack trace (see below)from mini-core are unrelated functions. As per code none…

ultimate cause
- 2,264
- 4
- 27
- 44
0
votes
0 answers
Xfce4 goes black randomly on DragonFly BSD release 4.2.4
The xfce4 desktop environment goes black on random occasions during use.
Install xf86-video-ffbdev.
Will post updates here, and the solution as soon as I've found it.
$ uname -v
DragonFly v4.2.4-RELEASE #6: Sun Aug 9 13:25:14 EDT 2015 …

Olle Härstedt
- 3,799
- 1
- 24
- 57
0
votes
2 answers
Is there a need for file descriptor control program/syscall?
I am currently thinking of implementing a syscall in some BSD flavours in order to close a given file descriptor.
The file descriptor would be defined as a pair of PID and file descriptor number.
It will be useful in order to test/debug a program…

benjamin
- 1
0
votes
1 answer
Get given process name and ppid programmatically
On Linux and other POSIX (?) operating systems - how to get name and parent pid of given (by pid) process? Currently I'm reading /proc but OSX doesn't have it. On OSX I'm using libproc but that doesn't work on Linux:
int ret = proc_pidpath (pid,…

Jerry Epas
- 245
- 3
- 9
0
votes
1 answer
How to use route to make a protocol specific route
BSD/MacOS X has a command "route" for altering the system routing table. One of the options that it supports is -proto1 (as well as proto2/proto3) which are for setting a route to be protocol specific. I am wanting to use this to set a route that is…

brant
- 369
- 3
- 8
0
votes
2 answers
Why signal handling is malfunctioning?
I have a signal handling snippet but it is somehow malfunctioning on my Mac and virtual Linux box at koding.com but on my office Linux PC it is working..Can someone please tell me why..
#include
#include
#include…

Mayukh Sarkar
- 2,289
- 1
- 14
- 38
0
votes
1 answer
Matching pattern including newline with OS X (BSD) sed
I want to match the following patterns using sed on OSX:
test = {
and
test =
{
I tried a lot of different things, including the line below but I can't figure out why it doesn't work:
sed -n -E -e "s/(^[a-zA-Z_]*[ ]*=[ "'\'$'\n'"]*{.*)/var \1/p"…

Pieter-Jan
- 450
- 5
- 9
0
votes
2 answers
using awk to lookup and insert data
In my continuing crusade not to use MS Excel, I'd like to process some data, send it to a file, and then insert some records from a separate file into a third file using field $1 as the index. Is this possible?
I have data like…

Registered User
- 255
- 4
- 12
0
votes
1 answer
Problems using find and cp to copy just .jpg files from a LOT of directories to one new path
I tried the search, but couldn't find the answer to my specific problem.
When I use,
find /recovered_files "*.jpg" -type f -exec cp {} /out \;
to copy all .jpg files from directories within the /recovered_files directory, the /out directory gets…

Mark Evans
- 3
- 1
0
votes
1 answer
use awk to group and calculate data
I'd like to use gawk to group some data and do calculations on a csv file.
Raw sample data:
2600,AEIOU-2600,stack,2,04/01/2015,C C S,S,10.65
2600,AEIOU-2600,stack,3,04/20/2015,C C R,S,100
2600,AEIOU-2600,stack,1,04/28/2015,C C…

Registered User
- 255
- 4
- 12
0
votes
1 answer
awk calculations based on field value
BIG EDIT
I had a misunderstanding on the calculations so I'll need to re-do this.
Raw sample data:
2600,AEIOU-2600,stack,01,04/28/2015,C C R,S,1.07
2600,AEIOU-2600,stack,02,04/01/2015,C C S,S,10.65
2601,"over, L.P. - 00001",stack,01,04/01/2015,C C…

Registered User
- 255
- 4
- 12