{"id":1477,"date":"2006-12-21T01:59:06","date_gmt":"2006-12-20T16:59:06","guid":{"rendered":"http:\/\/yasu2.prosou.nu\/blog\/index.php\/2006\/12\/21\/_vs_windows_1\/"},"modified":"2006-12-21T01:59:06","modified_gmt":"2006-12-20T16:59:06","slug":"_vs_windows_1","status":"publish","type":"post","link":"https:\/\/yasu2.prosou.nu\/blog\/index.php\/2006\/12\/21\/1477\/","title":{"rendered":"\u304a\u308c\u3055\u307e vs Windows"},"content":{"rendered":"<p>\u304d\u3087\u3046\u3082 Windows\u3002<br \/>\n\u3064\u307e\u308a\u3001Windows \u306f Unix \u3058\u3083\u306a\u3044\u3063\u3066\u3053\u3068\u306a\u3093\u3067\u3059\u304c\u3002\u3044\u3044\u52a0\u6e1b POSIX \u6e96\u62e0\u306a API \u7528\u610f\u3057\u308d\u3088\u30b3\u30ce\u30e4\u30ed\u30a6\u3002<br \/>\n(DOS \u306e INT 21h \u306f\u308f\u308a\u3068 Unix \u3001\u3068\u3044\u3046\u304b stdio.h \u306a\u611f\u3058\u306e function call \u304c\u3044\u3063\u3071\u3044\u3042\u3063\u305f\u3088\u306a\u30fc\u3001\u3068\u304b\u601d\u3046&#8230;)<br \/>\n&#8211; \u9ed2\u3044\u30a6\u30a3\u30f3\u30c9\u30a6<br \/>\nmingw \u3067 GTK \u306a\u30b3\u30fc\u30c9\u3092\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u3066\u3001explorer \u304b\u3089\u5b9f\u884c\u3059\u308b\u3068\u3001\u9ed2\u3044\u30a6\u30a3\u30f3\u30c9\u30a6\u304c\u958b\u3044\u3066\u305d\u3053\u304c stdout \u306b\u306a\u308b\u3093\u3067\u3059\u304c\u3001\u3042\u307e\u308a\u306b\u304b\u3063\u3053\u60aa\u3044\u3058\u3083\u306a\u3044\u3059\u304b\u3002\u3068\u3044\u3046\u308f\u3051\u3067\u3001\u30ea\u30f3\u30af\u3059\u308b\u3068\u304d\u306b -Wl,&#8211;subsystem,windows \u3092\u4ed8\u3051\u3066\u307f\u307e\u3057\u305f\u3002\u6d88\u3048\u307e\u3057\u305f\u3002\u308f\u30fc\u3044\u3002<br \/>\n&#8211; getenv(&#8220;PWD&#8221;)<br \/>\nmingw \u3068\u304b cygwin \u306e shell \u304b\u3089\u5b9f\u884c\u3059\u308b\u3068\u304d\u306f\u3053\u308c\u3067 current directory \u304c\u308f\u304b\u308b\u3093\u3060\u3051\u3069\u3001\u3075\u3064\u3046\u306b explorer \u304b\u3089\u5b9f\u884c\u3059\u308b\u3068\u30c0\u30e1\u307f\u305f\u3044\u3002getcwd() \u4f7f\u3046\u3079\u3057\u3002<br \/>\n&#8211; \u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u306e escape \u6587\u5b57\u3068\u304b<br \/>\n&#038; \u306f\u3001unix \u306e\u305f\u3044\u3066\u3044\u306e\u30b7\u30a7\u30eb\u3067\u3044\u3046\u3068\u3053\u308d\u306e ; \u3067\u3042\u308a\u3001dir &#038; dir \u3068\u304b\u3059\u308b\u3068\u30012\u5ea6\u5b9f\u884c\u3055\u308c\u308b\u3002<br \/>\n\u3061\u306a\u307f\u306b\u3001; \u306f\u30ea\u30b9\u30c8\u8868\u73fe\u306e\u3068\u304d\u306e\u30b9\u30da\u30fc\u30b9\u307f\u305f\u3044\u306a\u533a\u5207\u308a\u6587\u5b57\u3067\u3042\u308a\u3001\u3064\u307e\u308a\u3001sh \u3067 PATH=\/bin:\/sbin \u3068\u66f8\u304f\u308f\u3051\u3060\u304c\u3001\u305d\u308c\u3068\u540c\u3058\u30ce\u30ea\u3067 ; \u3092\u4f7f\u3046\u6a21\u69d8\u3002<br \/>\n\u3093\u3067\u3001\u3053\u3046\u3044\u3046\u3084\u3064\u3089\u3092 escape \u3057\u3066\u3084\u308b\u306b\u306f\u3001\\ (backslash) \u3067\u306f\u306a\u304f\u3066\u3001\u306a\u3093\u3068 ^ (hat) \u3092\u4f7f\u3046\u3093\u3067\u3059\u3088! \u4fe1\u3058\u3089\u308c\u307e\u305b\u3093!!<br \/>\n\u3057\u305f\u304c\u3063\u3066\u3001Cygwin \u3084 MinGW \u3067 system() \u3092\u4f7f\u3046\u5834\u5408\u306b\u306f\u3001\u4e92\u63db\u6027\u304c\u5931\u308f\u308c\u308b\u304a\u305d\u308c\u304c\u3042\u308b\u306e\u3067\u8981\u6ce8\u610f\u3067\u3059\u3002<br \/>\n&#8211; fork() \u3057\u305f\u3044<br \/>\nWin32 API \u306b\u306f fork() \u307f\u305f\u3044\u306a\u3053\u3068\u3092\u3084\u308b\u306e\u306f\u306a\u3044\u3093\u3060\u305d\u3046\u3060\u3002\u3042\u3068\u3001pipe \u3082\u306a\u3044\u3089\u3057\u3044\u3002<a href=\"http:\/\/www.scn-net.ne.jp\/~garakuta\/\">\u306e\u3059\u3051\u5e2b\u5320<\/a>\u306b\u3088\u308c\u3070\u3001cygwin \u306f\u3053\u306e\u3042\u305f\u308a\u3092\u3001\u304b\u306a\u308a\u3059\u3054\u3044\u4ed5\u639b\u3051\u3067\u89e3\u6c7a\u3057\u3066\u3044\u308b\u306e\u3060\u305d\u3046\u3067\u3001\u3060\u304b\u3089\u9045\u3044\u3068\u306e\u3053\u3068\u3002\u307b\u3078\u30fc\u3002\u3067\u3001MinGW \u306b\u3082 fork() \u306f\u306a\u3044\u308f\u3051\u3067\u3059\u304c\u3002<br \/>\n\u3067\u3001\u306a\u3093\u3067 fork() \u3057\u305f\u304b\u3063\u305f\u304b\u3068\u3044\u3046\u3068\u3001\u30d6\u30e9\u30a6\u30b6\u3092\u958b\u304f\u306e\u306b<br \/>\nrundll32 url.dll,FileProtocolHandler http:\/\/hogehoge.org\/<br \/>\n\u3068\u304b\u3057\u3066\u3084\u308c\u3070\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30d6\u30e9\u30a6\u30b6\u304c\u8d77\u52d5\u3059\u308b\u308f\u3051\u3067\u3059\u304c\u3001MinGW \u306e system() \u3068\u304b\u3067\u547c\u3076\u3068 cmd.exe \u306e\u9ed2\u3044\u30a6\u30a3\u30f3\u30c9\u30a6\u304c\u51fa\u3066\u304d\u3066\u304b\u3063\u3053\u60aa\u3044\u3093\u3067\u3059\u3088\u3002\u307e\u3042\u3001\u7c21\u5358\u306a\u30d7\u30ed\u30b0\u30e9\u30e0\u3067 execvp() \u3064\u304b\u3063\u3066\u307f\u305f\u3089\u3001\u3084\u3063\u3071\u308a\u9ed2\u3044\u30a6\u30a3\u30f3\u30c9\u30a6\u958b\u304f\u304b\u3089\u3001fork() \u3067\u304d\u3066\u3082\u610f\u5473\u306a\u304b\u3063\u305f\u3093\u3067\u3059\u304c\u3002<br \/>\n\u7d50\u5c40\u306e\u3068\u3053\u308d\u3001glib \u306b\u5165\u3063\u3066\u308b\u3001g_spawn_command_line_async() \u3068\u3044\u3046\u306e\u3092\u4f7f\u3063\u3066\u4e00\u767a\u3067\u89e3\u6c7a\u3057\u305f\u3002\u3053\u308c\u4f7f\u3046\u3068\u3001\u30a8\u30b9\u30b1\u30fc\u30d7\u6587\u5b57\u304c\u5909\u306a\u306e\u3068\u304b\u3001\u305d\u3046\u3044\u3046\u554f\u984c\u3082\u4e00\u6c17\u306b\u89e3\u6c7a\u3067\u304d\u3066\u3001Unix \u3067 system() \u3092\u547c\u3076\u306e\u3068\u307b\u3068\u3093\u3069\u540c\u3058\u30ce\u30ea\u3067 Windows \u3067\u3082\u4f7f\u3048\u308b\u306e\u3067\u3001\u975e\u5e38\u306b\u3044\u3044\u611f\u3058\u3002Glib \u3068\u304b GTK \u3068\u304b\u4f5c\u3063\u3066\u308b\u4eba\u305f\u3061\u306f\u3001\u307b\u3093\u3068\u3059\u3052\u30fc\u3063\u3059\u3002\u982d\u304c\u4e0b\u304c\u308a\u307e\u3059\u3002<br \/>\n\u304a\u304b\u3052\u3067\u3001#ifdef \u3068\u304b\u4f7f\u3063\u305f platform specific \u306a\u8a18\u8ff0\u3092\u6e1b\u3089\u305b\u307e\u3057\u305f\u3002\u3070\u3093\u3056\u30fc\u3044\u3002<br \/>\n&#8211; ldd \u3057\u305f\u3044<br \/>\nldd \u304c\u306a\u3044\u304b\u3089 dll \u306e\u4f9d\u5b58\u95a2\u4fc2\u304c\u308f\u304b\u3093\u306a\u3044\u3059\u3088\u30fc\u3001\u3068\u601d\u3063\u3066\u56f0\u3063\u3066\u305f\u306e\u3060\u3051\u308c\u3069\u3001cygwin \u306b\u3064\u3044\u3066\u304f\u308b cygcheck \u3068\u3044\u3046\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u89e3\u6c7a\u3002<br \/>\ncygcheck .\/hogehoge.exe<br \/>\n\u307f\u305f\u3044\u306a\u611f\u3058\u3060\u3002dll \u306e\u4f9d\u5b58\u95a2\u4fc2\u3092 recursive \u306b\u8fbf\u3063\u3066\u3001\u7d50\u679c\u304c\u30a4\u30f3\u30c7\u30f3\u30c8\u3057\u3066\u8868\u793a\u3055\u308c\u308b\u306e\u304c\u304a\u3082\u3057\u308d\u3044\u3002<br \/>\n&#8211; \u30a2\u30a4\u30b3\u30f3\u3064\u3051\u305f\u3044<br \/>\n.exe \u30d5\u30a1\u30a4\u30eb\u306b\u30ea\u30bd\u30fc\u30b9\u3092\u57cb\u3081\u8fbc\u3080\u3068\u30a2\u30a4\u30b3\u30f3\u3068\u304b\u3064\u3051\u3089\u308c\u308b\u308f\u3051\u3067\u3059\u304c\u3001GNU \u306e linker \u306f\u305d\u306e\u307e\u307e\u3058\u3083\u30ea\u30bd\u30fc\u30b9\u30d5\u30a1\u30a4\u30eb\u3092\u6271\u3046\u3053\u3068\u304c\u3067\u304d\u306a\u3044\u306e\u3067\u3001windres \u3068\u3044\u3046\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u3042\u308b\u6a21\u69d8\u3002\u3053\u308c\u3092\u4f7f\u3046\u3068\u3001\u30ea\u30bd\u30fc\u30b9\u30d5\u30a1\u30a4\u30eb\u304b\u3089 .o \u30d5\u30a1\u30a4\u30eb\u3092\u751f\u6210\u3057\u3066\u3001\u3053\u308c\u3092\u30ea\u30f3\u30af\u3057\u3066\u3084\u308c\u3070\u3044\u3044\u307f\u305f\u3044\u3060\u3002\u3075\u30fc\u3080\u3002<br \/>\n\u3067\u3001\u30ea\u30bd\u30fc\u30b9\u30d5\u30a1\u30a4\u30eb\u3063\u3066\u3069\u3046\u3084\u3063\u3066\u66f8\u304f\u3093\u3060\u308d\u3046&#8230;<br \/>\n\u4eca\u65e5\u306f\u305d\u3093\u306a\u611f\u3058\u3002\u672c\u8cea\u7684\u306a\u5b9f\u88c5\u306f\u5168\u7136\u9032\u307e\u306a\u304b\u3063\u305f\u6c17\u304c\u3059\u308b\u304c\u3001\u307e\u3042\u3044\u3044\u304b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u304d\u3087\u3046\u3082 Windows- fork() \u3057\u305f\u3044Win32 API \u306b\u306f fork() \u307f\u305f\u3044\u306a\u3053\u3068\u3092\u3084\u308b\u306e\u306f\u306a\u3044\u3093\u3060\u305d\u3046\u3060\u3002&#8230;  cygwin \u306f\u3053\u306e\u3042\u305f\u308a\u3092\u3001\u304b\u306a\u308a\u3059\u3054\u3044\u4ed5\u639b\u3051\u3067\u89e3\u6c7a\u3057\u3066\u3044\u308b\u306e\u3060\u305d\u3046\u3067\u3001\u3060\u304b\u3089- ldd \u3057\u305f\u3044ldd \u304c\u306a\u3044\u304b\u3089 dll \u306e\u4f9d\u5b58\u95a2\u4fc2\u304c\u308f\u304b\u3093\u306a\u3044\u3059\u3088\u30fc\u3001\u3068\u601d\u3063\u3066\u56f0\u3063\u3066\u305f\u306e\u3060\u3051\u308c\u3069\u3001cygwin \u306b\u3064\u3044\u3066\u304f\u308b cygcheck \u3068\u3044\u3046\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u89e3\u6c7a\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[3],"tags":[],"class_list":["post-1477","post","type-post","status-publish","format-standard","hentry","category-3"],"_links":{"self":[{"href":"https:\/\/yasu2.prosou.nu\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1477","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yasu2.prosou.nu\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yasu2.prosou.nu\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yasu2.prosou.nu\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/yasu2.prosou.nu\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=1477"}],"version-history":[{"count":0,"href":"https:\/\/yasu2.prosou.nu\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1477\/revisions"}],"wp:attachment":[{"href":"https:\/\/yasu2.prosou.nu\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=1477"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yasu2.prosou.nu\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=1477"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yasu2.prosou.nu\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=1477"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}