{"thread":{"id":"33024","subject":"Re: [PATCH] Improve QNX support in GIT","startedAt":"2013-02-26T20:13:05Z","lastAt":"2013-02-26T21:02:46Z","messageCount":4,"participants":["Matt Kraai","Mike Gorchak","Johannes Sixt"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"210362","messageId":"20130226201305.GA3502@ftbfs.org","threadId":"33024","inReplyTo":null,"subject":"Re: [PATCH] Improve QNX support in GIT","fromName":"Matt Kraai","fromEmail":"kraai@ftbfs.org","sentAt":"2013-02-26T20:13:05Z","receivedAt":"2013-02-26T20:13:05Z","isPatch":true,"sender":{"key":"kraai@ftbfs.org","avatar":null},"body":"Hi,\n\nPlease include me in the Cc field, since I'm not subscribed to the\nlist.\n\nMike Gorchak wrote:\n> Do you have a testcase for this (without using git codebase)? I wrote\n> numerous resource managers since QNX 6.0 using threads and fork()s for\n> daemonization in different order and never experienced a problems.\n> There can be issues with pipes in case of external command run.\n\nI just created the following one:\n\n\n#include <pthread.h>\n#include <stdio.h>\n#include <string.h>\n#include <errno.h>\n#include <sys/types.h>\n#include <process.h>\n\nstatic void *\nstart_routine (void *arg)\n{\n  return NULL;\n}\n\nint\nmain (int argc, char **argv)\n{\n  int err;\n\n  if ((err = pthread_create (NULL, NULL, start_routine, NULL)))\n    {\n      fprintf (stderr, \"foo: pthread_create failed: %s\\n\", strerror (errno));\n      return 1;\n    }\n\n  if (fork () == -1)\n    {\n      fprintf (stderr, \"foo: fork failed: %s\\n\", strerror (errno));\n      return 1;\n    }\n\n  return 0;\n}\n\n\nWhen I compile and run it on either QNX 6.3.2 or QNX 6.5.0, it\nproduces the following output:\n\n foo: fork failed: Function not implemented\n\nIf I remove the call to pthread_create, it doesn't output anything and\nexits successfully.\n"},{"id":"210367","messageId":"CAHXAxrOcC7GX-rhT793t4vcF68TvrE9w9OW856+7cGDBGMx0VA@mail.gmail.com","threadId":"33024","inReplyTo":"20130226201305.GA3502@ftbfs.org","subject":"Re: [PATCH] Improve QNX support in GIT","fromName":"Mike Gorchak","fromEmail":"mike.gorchak.qnx@gmail.com","sentAt":"2013-02-26T20:32:16Z","receivedAt":"2013-02-26T20:32:16Z","isPatch":true,"sender":{"key":"mike.gorchak.qnx@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1337711?v=4"},"body":"> If I remove the call to pthread_create, it doesn't output anything and\n> exits successfully.\n\nI see. Most resource managers use procmgr_daemon(), which has no such\nlimitation. Anyway, as far as I can see current git sources do not use\nfork together with pthread, except for daemonize() function.\n"},{"id":"210369","messageId":"512D20C5.7050305@kdbg.org","threadId":"33024","inReplyTo":"CAHXAxrOcC7GX-rhT793t4vcF68TvrE9w9OW856+7cGDBGMx0VA@mail.gmail.com","subject":"Re: [PATCH] Improve QNX support in GIT","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2013-02-26T20:53:25Z","receivedAt":"2013-02-26T20:53:25Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 26.02.2013 21:32, schrieb Mike Gorchak:\n>> If I remove the call to pthread_create, it doesn't output anything and\n>> exits successfully.\n> \n> I see. Most resource managers use procmgr_daemon(), which has no such\n> limitation. Anyway, as far as I can see current git sources do not use\n> fork together with pthread, except for daemonize() function.\n\nNot true: When a clean or smudge filter is configured, a thread is\ncreated, and the thread runs the external program via fork().\n\n-- Hannes\n"},{"id":"210370","messageId":"20130226210246.GB3502@ftbfs.org","threadId":"33024","inReplyTo":"CAHXAxrOcC7GX-rhT793t4vcF68TvrE9w9OW856+7cGDBGMx0VA@mail.gmail.com","subject":"Re: [PATCH] Improve QNX support in GIT","fromName":"Matt Kraai","fromEmail":"kraai@ftbfs.org","sentAt":"2013-02-26T21:02:46Z","receivedAt":"2013-02-26T21:02:46Z","isPatch":true,"sender":{"key":"kraai@ftbfs.org","avatar":null},"body":"On Tue, Feb 26, 2013 at 10:32:16PM +0200, Mike Gorchak wrote:\n> I see. Most resource managers use procmgr_daemon(), which has no such\n> limitation. Anyway, as far as I can see current git sources do not use\n> fork together with pthread, except for daemonize() function.\n\nIf threads are enabled, git does use fork after calling pthread_create:\n\n * When I run \"git grep foo\".\n * When I run \"git fetch\" to update my git working copy, which is\n   using an HTTPS remote.\n\nBoth of these commands fail as a result.\n"}]}