darwin

OSX 10.5 Leopard Symbol Mangling with $non_lazy_ptr

Why does Leopard mangle some symbols with $non_lazy_ptr? More importantly what is the best method to fix undefined symbol errors because a symbol has been mangled with $non_lazy_ptr? ...

Opensource Streaming Server application?

I am looking for opensource Streaming server. I have played around VLS/VLC before. Have any of you used Darwin from Apple? Are there any other options available? ...

Determine Process Info Programmatically in Darwin/OSX

I have a class with the following member functions: /// caller pid virtual pid_t Pid() const = 0; /// physical memory size in KB virtual uint64_t Size() const = 0; /// resident memory for this process virtual uint64_t Rss() const = 0; /// cpu used by this process virtual double PercentCpu() const = 0; /// memory used by this p...

Steps to compile darwin for arm on ubuntu gcc

Has anyone got the steps to compile darwin libraries on gcc for arm on ubuntu? ...

Why does lseek return 0?

lseek() is supposed to return the position of the file descriptor. The documentation says: Upon successful completion, lseek() returns the resulting offset location as measured in bytes from the beginning of the file. Otherwise, a value of -1 is returned and errno is set to indicate the error. Trouble is, not even ...

Two versions of mysql on one Mac server, need to get data from one to other

My sysadmin patches my Mac server, and suddenly MySQL is pointing at a version 5 install. Prior to this, it was pointing to a version 4 install. My data is stranded in the version 4. Somehow whenever I run the mysql command I end up in the version 5. I need to do a mysqldump of the version 4 stuff to put it in v5. I'm not sure how to:...

grep'ing output from continuously updated output

I'm trying to write a simple script around Lame to customize the program for my specific uses. What I'd like to do is parse out just the percent completeness from the Lame output. Here's what the line looks like now: ./lame --nohist ~/Desktop/Driver.wav ~/Desktop/Driver.mp3 2>&1| egrep -o "\([0-9\%]+\)" But that returns nothing. Here...

Darwin Streaming Server Log Format?

Hi, I am writing a program that will parse and manipulate logs from Darwin Streaming Servers. Where can I get a definition of what the individual fields headers mean? Are there some kind of documentation in the DSS doc files? For example, I have this as the log output header: c-ip date time c-dns cs-uri-stem c-starttime x-duration...

Java OS X Dock Menu

Is it possible to add items to the applications dock menu? EDIT: I think i miss phrased the question, i am not looking for a way to add an icon to the dock. what i am looking for is, when you right click on the itunes icon you get itunes control on the menu (play pause etc) i was wondering how can i add custom items to that menu. ...

How can I pre-authorize authopen?

I'm using authopen inside one of my programs to modify files owned by root. As can be seen in the screenshot below authopen asks for a admin password. What I'd like to achieve is that the dialog shows my app's name and then passes the authorization to authopen. Code Launching authopen which returns an authorized file descriptor. int...

How does stat() work?

stattest.c: // compile: gcc -o stattest stattest.c #include <stdio.h> #include <sys/stat.h> int main(int argc, char *argv[]) { struct stat stats; stat(argv[1], &stats); printf("%lli\n", (long long)stats.st_dev); return 0; } Usage: stat -f "%r" /dev/disk0 => 234881024 (Value that I'm looking for.) ....

How to REALLY strip a binary in MacOs

MacOs 10.6, if I have a file "unwanted.c" which contains: class secret_thing { public: secret_thing() {} void revealing_method_name() {} }; main() { secret_thing obj; obj.revealing_method_name(); } Now I do: $ g++ unwanted.c -o unwanted $ strip unwanted $ nm unwanted | grep secret 0000000100000eb8 T __ZN12secret_thing21revea...

EADDRNOTAVAIL when binding 127.0.0.1 on localhost?

I'm getting errno==49 (EADDRNOTAVAIL) when trying to UDP-bind() to 127.0.0.1:47346 running Mac OS X on a G5 (big endian PowerPC). Is there something preventing me from doing so? I've tried other addresses and ports (192.168.1.2 and port 47346) but with no success. Here's a gdb printout of my sockaddr_in: $1 = { sin_len = 0 '\0', s...

STLport crash (race condition, Darwin only?)

When I run STLport on Darwin I get a strange crash. (Haven't seen it anywhere else than on Mac, but exactly same thing crash on both i686 and PowerPC.) This is what it looks like in gdb: Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: 13 at address: 0x0000000000000000 [Switching to process 21097] 0x000000010120f...

OSX/Darwin unresolved symbols when linking functions from <math.h>

I'm in the process of porting a large'ish (~1M LOC) project from a Window/Visual Studio environment to other platforms, the first of which happens to be Mac OS X. Originally the project was configured as Visual Studio solutions and projects, but now I'm using (the excellent) Premake (http://industriousone.com/premake) to generate proje...

Does operator new allocate on THREAD heap?

My problem seems to be this: heap data allocated by one thread (that later dies) seems to die as well. As so: Thread X: starts Thread Y: starts Thread X: ptr = new some bytes Thread X: dies Thread Y: tries to use ptr - and crashes! So far, I've only seen this problem on Darwin (Mac OS 10.5 and 10.6), but haven't tried more other plat...

Looking for the Mach-O loader source code in the Darwin sources.

As I understand it, Mach-O should be part of the Darwin open source packages. Could someone please help me locate the loader? I've no idea where it is and where to download that code from. Any help would be greatly appreciated! ...

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 exception codes that is passed to the handler are 32 bits wide. This is expected in a 32 bit bui...

Using *Darwin as a test bed for Mac OSX applications

Since Mac virtualization is technically illegal on anything but a Mac computer, is it possible to use one of the Darwin distros as a platform to test applications meant for Mac OSX? From the little I've read, it seems *Darwin and MacOSX have a very tight relationship, but I haven't really found any information on the internet about usi...

building odcctools in a 64-bit OS

The odcctools package provides binutils for the Darwin OS. -- this allows you to cross compile to Darwin and OSX for example. However, odcctools does not seem to build properly on 64-bit OSes: ./../expr.c: In function ‘expression’: ./../expr.c:311: error: ‘union <anonymous>’ has no member named ‘n_name’ Or, if you set CFLAGS to -m32, ...