Darwin is the open-source core of macOS, iOS, tvOS and watchOS. It is derived from NeXTStep, Mach, and *BSD; the kernel is called XNU.
Questions tagged [darwin]
367 questions
163
votes
3 answers
How to get mathemical PI constant in Swift
I am trying to find a way to include the PI constant in my Swift code. I already found help in another answer, to import Darwin which I know gives me access to C functions.
I also checked the Math package in Darwin and came across the following…

nburk
- 22,409
- 18
- 87
- 132
144
votes
10 answers
Is there an equivalent of lsusb for OS X
This question seems to be all over google, but the answers all point to using System Profiler. That's nice, but with System Profiler all you get is something that looks like this:
DasKeyboard:
Product ID: 0x1919
…

Ted Middleton
- 6,859
- 10
- 51
- 71
99
votes
3 answers
Using Rsync include and exclude options to include directory and file by pattern
I'm having problems getting my rsync syntax right and I'm wondering if my scenario can actually be handled with rsync. First, I've confirmed that rsync is working just fine between my local host and my remote host. Doing a straight sync on a…

Sheldon Chang
- 1,215
- 1
- 9
- 9
93
votes
5 answers
Print rpath of an executable on macOS
I want to change the rpath of an executable using install_name_tool, but I can't figure out what the rpath is right now. install_name_tool requires both the old and the new rpath's to be given on the commandline. What command can I use to print the…

staticfloat
- 6,752
- 4
- 37
- 51
36
votes
6 answers
How to enable C++17 on Mac?
I am able to update gcc on Linux to get -std=c++17, but cannot do the same on Mac.
Is there a version of Clang I can update to or some other alternative to get C++ 17 on my Mac?
Please help.
Thanks.

TheBigMalaka
- 361
- 1
- 3
- 3
26
votes
3 answers
An objcopy equivalent for Mac / iPhone?
I would like to rename symbols inside object files (.o) with something that would be the Mac equivalent of binutils' objcopy --redefine-syms tool.
I found no arm-apple-darwin10-objcopy. I tried the MacPorts' arm-elf-binutils port and also tried to…

Gregory Pakosz
- 69,011
- 20
- 139
- 164
23
votes
2 answers
What is the deal with undefined symbols in a shared library or dylib?
I have a Makefile for linux that I am porting over to Darwin. The makefile takes a bunch of .o files and links them together into a .so shared object. Okay, so I figured (am I wrong about this?) that the best analog for this in Darwin is the…

eeeeaaii
- 3,372
- 5
- 30
- 36
23
votes
4 answers
make fails while installing Valgrind
I'm trying to install Valgrind on a Mac with Snow Leopard but am getting an error. This is what I'm typing into Terminal.
$ curl -O http://valgrind.org/downloads/valgrind-3.8.1.tar.bz2
$ md5sum valgrind-3.8.1.tar.bz2
$ tar -xjvf…

Jack Stout
- 1,265
- 3
- 12
- 25
20
votes
3 answers
Interpret dtruss output like “psynch_cvwait(...) = -1 Err#316”
dtruss appears to be a useful tool to analyze the (mis-)behaviour of applications on OS X. The closes thing I found to my beloved strace on linux. But interpreting its output requires an understanding of the syscalls it refers to, and sometimes the…

MvG
- 57,380
- 22
- 148
- 276
19
votes
2 answers
Why does host_statistics64() return inconsistent results?
Why does host_statistics64() in OS X 10.6.8 (I don't know if other versions have this problem) return counts for free, active, inactive, and wired memory that don't add up to the total amount of ram? And why is it missing an inconsistent number of…

Chas. Owens
- 64,182
- 22
- 135
- 226
18
votes
3 answers
How can I use mach_absolute_time without overflowing?
On Darwin, the POSIX standard clock_gettime(CLOCK_MONOTONIC) timer is not available. Instead, the highest resolution monotonic timer is obtained through the mach_absolute_time function from mach/mach_time.h.
The result returned may be an unadjusted…

Nicholas Wilson
- 9,435
- 1
- 41
- 80
17
votes
1 answer
Cross-compiling for OS X from Linux
Is there an easy to use tool-chain to compile code for Darwin (mac's OS) from Linux?
For example, I would like to compile libpcap (or tcpdump) on a Linux machine and run in on my MAC. I've come across osxcross but it requires getting the Xcode SDK…

Blondy314
- 751
- 9
- 24
16
votes
3 answers
setting up terraform v0.14.0 on Apple M1
Any pointers how to setup Terraform v0.14.0 on a Apple M1 , as tfenv doesn't support v0.14.0 on Apple M1
tfenv install v0.14.0
Installing Terraform v0.14.0
Downloading release tarball from…

Avi
- 1,453
- 4
- 18
- 43
16
votes
1 answer
Handling mach exceptions in 64bit OS X application
I have been able to register my own mach port to capture mach exceptions in my applications and it works beautifully when I target 32 bit. However when I target 64 bit, my exception handler catch_exception_raise() gets called but the array of…

Brad S
- 585
- 3
- 12
15
votes
2 answers
What is '@_silgen_name' in Swift language?
While reading Darwin library in Swift 2.2, I found below codes.
@warn_unused_result
@_silgen_name("_swift_Darwin_sem_open2")
internal func _swift_Darwin_sem_open2(
name: UnsafePointer,
_ oflag: CInt
) -> UnsafeMutablePointer
What…

SeungHyun Lee
- 153
- 1
- 6