[問題] sched.h ? [已解決]
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
Linux gcc
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
<sched.h>
問題(Question):
最近在看 http://www.waterlike.com.tw/bookdata.asp?NO=TP3C107131 這本書
第七章關於 clone() 還是不太明白
於是就照著書上 code 7.2 在 vim 寫了一下小測試
首先,sleep() 是 <unistd.h> 裡的作者沒寫先不婊(誤
我的 gcc 說
warning: passing argument 4 of ‘clone’ makes pointer from integer without
a cast /usr/include/bits/sched.h:83: note: expected ‘void *’ but argument
is of type ‘int’
查了一下 clone 的原型
int clone(int (*fn)(void *), void *child_stack, int flags, void *arg);
請問第一個參數的用法
程式碼(Code):(請善用置底文網頁, 記得排版)
http://codepad.org/1HGNEFhV
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 210.60.107.233
→
06/09 13:02, , 1F
06/09 13:02, 1F
→
06/09 13:03, , 2F
06/09 13:03, 2F
→
06/09 13:03, , 3F
06/09 13:03, 3F
→
06/09 13:05, , 4F
06/09 13:05, 4F