C++ alternative to C header files

Hey,

I've been working on creating a daemon and I've been following these very similar tutorials:

http://shahmirj.com/blog/beginners-guide-to-creating-a-daemon-in-linux

http://www.netzmafia.de/skripten/unix/linux-daemon-howto.html

and they include the following headers:

1
2
3
4
5
6
7
8
9
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
#include <syslog.h>
#include <string.h> 


I've gone through various online resources and man pages to figure out what each of the headers offer and stripped away the ones that aren't absolutely required and this is what I was left with (the comments are why they're required):

1
2
3
4
5
#include <sys/types.h> // pid_t, umask()
#include <sys/stat.h> // umask()
#include <stdlib.h> // exit()
#include <unistd.h> // setsid()
#include <syslog.h> // openlog(), syslog(), closelog(), setlogmask() 


I read that you should use iostream instead of iostream.h

http://members.gamedev.net/sicrane/articles/iostream.html

so I tried finding C++ versions of the C headers but I'm not having much luck. I found cstdlib to replace stdlib.h but I can't find alternatives for the other 4.

Are there C++ versions of those C headers? Does it matter at all?
Last edited on
The 4 remaining headers are Unix specific and AFAIK there are no c++ equivalent headers.
Good to know, thanks
Registered users can post here. Sign in or register to post.