Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
daemon.c
Package: rtsp-1.0.1.tar.gz [view]
Upload User: sy_wanhua
Upload Date: 2013-07-25
Package Size: 3048k
Code Size: 2k
Category:
Streaming_Mpeg4
Development Platform:
C/C++
- /*----------------------------------------------------------------------*
- daemon.c
- This module has the functions needed for a program to become a daemon.
- Copyright (c) 1997-1999 Quicknet Technologies, Inc.
- Written by Greg Herlein <gherlein@quicknet.net>, donated to Quicknet
- Technologies, Inc. 6/10/99.
- * This is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License (LGPL) as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA. It is also available online at
- * http://www.gnu.org/copyleft/lesser.html
- /*-------------------------------< RCS >--------------------------------*/
- static char RCS_ID[] = "$Id: daemon.c,v 1.1.1.1 1999/07/16 01:26:02 bogawa Exp $";
- /*----------------------------< Defines >-------------------------------*/
- /*----------------------------< Includes >------------------------------*/
- /* stdlib */
- #include <unistd.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <fcntl.h>
- /* other */
- #include "daemon.h"
- /*---------------------------< Definitions >----------------------------*/
- /*--------------------------< Declarations >----------------------------*/
- /*------------------------< Global Variables >--------------------------*/
- /*-------------------------< Local Variables >--------------------------*/
- /*----------------------------------------------------------------------*/
- int
- daemon_init(void)
- {
- pid_t pid;
- pid=fork();
- if(pid<0) return -1;
- else if(pid!=0) exit(0); /* parent exits */
- /* child continues and become session leader */
- setsid();
- return 0;
- }