bsd

How do I determine the target architecture of static library (.a) on Mac OS X?

瘦欲@ 提交于 2019-12-17 21:38:01
问题 I'm interested in verifying if a given iPhone static library has been built for ARM or Intel. It's more curiosity than anything. Is there some kind of Mac OS X or BSD specific tool to do this? This post gives an example in Linux. 回答1: Another option is lipo ; its output is brief and more readable than otool 's. An example: % lipo -info /usr/lib/libiodbc.a Architectures in the fat file: /usr/lib/libiodbc.a are: x86_64 i386 ppc % lipo -info libnonfatarchive.a input file libnonfatarchive.a is

Limitations of Intel Assembly Syntax Compared to AT&T [closed]

拜拜、爱过 提交于 2019-12-17 15:08:52
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . To me, Intel syntax is much easier to read. If I go traipsing through assembly forest concentrating only on Intel syntax, will I miss

What is the status of POSIX asynchronous I/O (AIO)?

纵然是瞬间 提交于 2019-12-17 06:22:23
问题 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 example, the "official" (?) web site for Linux kernel asynchronous I/O support here says that sockets don't work, but the "aio.h" manual pages on my Ubuntu 8.04.1 workstation all seem to imply that it works for arbitrary file descriptors. Then there's another project that seems to work at the library

BSD库函数手册翻译之pthread_join函数

有些话、适合烂在心里 提交于 2019-12-17 04:32:36
名称 pthread_join -- 等待线程结束 概要 #include <pthread.h> int pthread_join(pthread_t thread,void **value_ptr); 描述 除非目标线程已经终止,否则函数pthread_join()会 暂停调用线程 的 执行 ,直到 目标线程终止 为止。 当传入一个非NULL的参数value_ptr 来调用函数pthread_join() 并成功返回时,正在终止的线程传给函数pthread_exit() 的值被储存在由 value_ptr 所引用的位置。当函数pthread_join() 成功返回时,目标线程已经被终止了。对同一个目标线程同时多次调用函数pthread_join() 的结果是未定义的。若 调用函数pthread_join()的线程被取消 ,则 目标线程未被分离 。 返回值 若执行成功,则函数 pthread_join()将返回零。否则,将返回一个错误码来指示错误。 错误 函数pthread_join()在以下情形下会失败: [EINVAL] 实现已经检测到由线程指定的值没有引用到可连接的线程。 [ESRCH] 没有发现对应于给定线程ID thread的线程。 [EDEADLK] 检测到死锁或参数thread的值指定的是调用函数pthread_join()的线程。 另请参阅: wait(2),

unix command to copy all .h file with modified directory-structure

梦想与她 提交于 2019-12-11 18:19:39
问题 Suppose I have a folder structure like: Libraries\ UIToolkit\ files\ toolkit.h toolkit.c toolkit.resource NetworkLayer\ files\ network.h network-info.txt ... I need a command so that I can input the Libraries folder and specify a Output folder then in the Output folder I have: Output\ UIToolkit\ toolkit.h NetworkLayer\ network.h Basically it: copies all .h file and preserves the folder structure also move all the headers to its sub-libraries' root folders no matter how deep they are in the

Error while setting up netbsd crosscompiler

大憨熊 提交于 2019-12-11 14:44:49
问题 I am in the process of setting up a cross compiler for netbsd to sbmips with a mips64el processor. so I got the source and used ./build.sh -a mips64el -m sbmips and I got my toolchain with no errors. I continued to configure the kernel with: cd /usr/src/sys/arch/sbmips/conf /usr/src/tooldir.NetBSD-5.2.2-amd64/bin/nbconfig GENERIC this works, after this I go: cd ../compile/GENERIC /usr/src/tooldir.NetBSD-5.2.2-amd64/bin/nbmake-sbmips which fails with error code 1, Here is a link with 2 screens

Python clock function on FreeBSD

你说的曾经没有我的故事 提交于 2019-12-11 14:38:40
问题 While testing Pythons time.clock() function on FreeBSD I've noticed it always returns the same value, around 0.156 The time.time() function works properly but I need a something with a slightly higher resolution. Does anyone the C function it's bound to and if there is an alternative high resolution timer? I'm not profiling so the TimeIt module is not really appropriate here. 回答1: time.clock() returns the processor time. That is, how much time the current process has used on the processor. So

Sed remove matching lines script

青春壹個敷衍的年華 提交于 2019-12-11 12:33:52
问题 I'm requesting help with a very simple script... #!/usr/bin/sed -f sed '/11,yahoo/d' sed '/2506,stackover flow/d' sed '/2536,reddit/d' Just need it to remove three matches that account for 18408 in my file, data.csv % sed -f remove.sed < data.csv sed: 3: remove.sed: unterminated substitute pattern Doing these same lines individually is no problem at all, so what am I doing wrong with this? Using freeBSD 10.1 and its implementation of sed, if that matters. 回答1: This, being a sed script, should

Installing Ruby 1.9.3 Troubles with Clang

爷,独闯天下 提交于 2019-12-11 11:37:57
问题 I am attempting to install Ruby 1.9.3 on Mac OS X Lion, same method as I discovered here: Basically it's: rvm install 1.9.3 --with-gcc=clang --with-readline-dir=$rvm_path/usr However, this time Clang throws an error on the --with-readline-dir option: Larson:~ andrewjl$ rvm install 1.9.3 --with-gcc=clang --with-readline-dir=$rvm_path/usr clang: error: unsupported option '--with-readline' clang: error: unsupported option '--with-opt-dir=/Users/andrewjl/.rvm/usr' Is this an issue with Clang?

nftw different on BSD?

送分小仙女□ 提交于 2019-12-11 07:56:21
问题 I'm trying to get all .c files in a directory tree using nftw with the following code: static int gf(const char *path, const struct stat *st, int t, struct FTW *ftw) { if (t != FTW_F) return 0; if (strcmp(ext(path), ".c") == 0) addl(&files, dup(abspath(path))); return 0; } void getfiles(char *path) { nftw(path, gf, 255, FTW_PHYS); } It works on Linux and Solaris, but on PC-BSD it fails by simply not picking up any files. What am I missing? 回答1: What is the return value of nftw ? If it's -1