Last snippet works for me, dots get printed to the logfile as
expected.
Ok, it works now. Using the recommended _Exit() function with DMD
2.066 on Linux.
Thanks you all for your help!
Best regards,
Jeroen
On Sunday, 31 August 2014 at 09:02:55 UTC, JD wrote:
Last snippet works for me, dots get printed to the logfile as
expected.
Ok, it works now. Using the recommended _Exit() function with
DMD 2.066 on Linux.
Thanks you all for your help!
Best regards,
Jeroen
On a side note, i've created
On 30/08/2014 19:09, JD wrote:
My questions:
1. Are there any special considerations w.r.t. the GC after using
fork()? Or must it be disabled?
2. Is it allowed to use stdlib's exit() without cleaning up after the
runtime (as a normal end of program probably does)? Or is there a safe D
exit()?
Hi all,
I tried to write a Linux daemon in D 2.065 (by translating one
in C we use at work). My basic skeleton works well. But as soon
as I start allocating memory it crashed with several
'core.exception.InvalidMemoryOperationError's.
My questions:
1. Are there any special considerations
On Saturday, 30 August 2014 at 17:09:41 UTC, JD wrote:
Hi all,
I tried to write a Linux daemon in D 2.065 (by translating one
in C we use at work). My basic skeleton works well. But as soon
as I start allocating memory it crashed with several
'core.exception.InvalidMemoryOperationError's.
I had similar issues. Thing is D compiler places runtime cleanup
initialization code into binary constructor sections
(fini_array) which is needed to support shared libraries
properly. But the same code gets triggered when you run `exit` in
a fork resulting in attempt to terminate other
On Saturday, 30 August 2014 at 17:36:41 UTC, safety0ff wrote:
On Saturday, 30 August 2014 at 17:09:41 UTC, JD wrote:
Hi all,
I tried to write a Linux daemon in D 2.065 (by translating one
in C we use at work). My basic skeleton works well. But as
soon as I start allocating memory it crashed
Oops, I accidentally commented out the line allocating the memory
in the example code... sorry.
// this statement causes
core.exception.InvalidMemoryOperationError
// auto t = new char[4096];
should read:
// this statement causes
core.exception.InvalidMemoryOperationError
On Saturday, 30 August 2014 at 17:09:41 UTC, JD wrote:
Hi all,
Or is there a safe D exit()?
I always wondered why D doesnt have this. I tried searching
google and could not find a definitive answer except interfacing
with C...
I can already say that it nevertheless works with DMD git. Will
test soon with Digger, unfortunately Bitbucket is currently
down, and Digger depends on it.
In the meantime I installed DMD 2.066 and I changed the exit()
function after the fork as Dicebot suggested. Unfortunately I got
the
On Sat, 30 Aug 2014 19:20:44 +
Israel via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
Or is there a safe D exit()?
I always wondered why D doesnt have this.
the idiomatic way is to throw an exception which can be catched in
main() (and then we can `return 1` from main() or
On Saturday, 30 August 2014 at 19:20:39 UTC, JD wrote:
I can already say that it nevertheless works with DMD git.
Will test soon with Digger, unfortunately Bitbucket is
currently down, and Digger depends on it.
In the meantime I installed DMD 2.066 and I changed the exit()
function after the
I tested it again, and it works fine in both 2.065 and 2.066.
Be aware that you should comment out:
// close(STDOUT_FILENO);
// close(STDERR_FILENO);
A daemon normally detaches itself from the terminal by closing
the STD* files. All D's runtime exception messages will not
appear in
On Saturday, 30 August 2014 at 19:52:24 UTC, JD wrote:
I tested it again, and it works fine in both 2.065 and 2.066.
Be aware that you should comment out:
// close(STDOUT_FILENO);
// close(STDERR_FILENO);
A daemon normally detaches itself from the terminal by closing
the STD*
14 matches
Mail list logo