epoc32/include/stdapis/spawn.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
     1.1 --- a/epoc32/include/stdapis/spawn.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/stdapis/spawn.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,128 @@
     1.4 -spawn.h
     1.5 +/*
     1.6 +* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.7 +* All rights reserved.
     1.8 +* This component and the accompanying materials are made available
     1.9 +* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
    1.10 +* which accompanies this distribution, and is available
    1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.12 +*
    1.13 +* Initial Contributors:
    1.14 +* Nokia Corporation - initial contribution.
    1.15 +*
    1.16 +* Contributors:
    1.17 +*
    1.18 +* Description:
    1.19 +* Redistribution and use in source and binary forms, with or without 
    1.20 +* modification, are permitted provided that the following conditions are met:
    1.21 +* Redistributions of source code must retain the above copyright notice, this 
    1.22 +* list of conditions and the following disclaimer. 
    1.23 +* Redistributions in binary form must reproduce the above copyright notice, 
    1.24 +* this list of conditions and the following disclaimer in the documentation 
    1.25 +* and/or other materials provided with the distribution. 
    1.26 +* Neither the name of the <ORGANIZATION> nor the names of its contributors 
    1.27 +* may be used to endorse or promote products derived from this software 
    1.28 +* without specific prior written permission. 
    1.29 +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
    1.30 +* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
    1.31 +* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
    1.32 +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
    1.33 +* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
    1.34 +* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
    1.35 +* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
    1.36 +* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    1.37 +* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
    1.38 +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    1.39 +* 
    1.40 +*
    1.41 +*/
    1.42 +
    1.43 +
    1.44 +
    1.45 +
    1.46 +
    1.47 +#ifndef	_SPAWN_H_
    1.48 +#define	_SPAWN_H_
    1.49 +
    1.50 +#include <signal.h>
    1.51 +#include <sys/types.h>
    1.52 +#include <sched.h>
    1.53 +
    1.54 +typedef struct {
    1.55 +	short _flags;
    1.56 +	pid_t _pgrp;
    1.57 +	sigset_t _sd;
    1.58 +	sigset_t _sm;
    1.59 +	struct sched_param _sp;
    1.60 +	int _policy;
    1.61 +} posix_spawnattr_t;
    1.62 +
    1.63 +/* Flags that can be set in posix_spawnattr_t */
    1.64 +#define POSIX_SPAWN_RESETIDS		0x01
    1.65 +#define POSIX_SPAWN_SETPGROUP		0x02
    1.66 +#define POSIX_SPAWN_SETSIGDEF		0x04
    1.67 +#define POSIX_SPAWN_SETSIGMASK		0x08
    1.68 +#define POSIX_SPAWN_SETSCHEDPARAM	0x10
    1.69 +#define POSIX_SPAWN_SETSCHEDULER	0x20
    1.70 +
    1.71 +// forward declaration
    1.72 +struct file_actions_t;
    1.73 +typedef struct {
    1.74 +	int _cnt;
    1.75 +	struct file_actions_t* _fa;
    1.76 +} posix_spawn_file_actions_t;
    1.77 +
    1.78 +__BEGIN_DECLS
    1.79 +
    1.80 +IMPORT_C int posix_spawn(pid_t* pid, const char* path,
    1.81 +				const posix_spawn_file_actions_t* file_actions,
    1.82 +				const posix_spawnattr_t* attrp, char *const argv[],
    1.83 +				char *const envp[]);
    1.84 +				
    1.85 +IMPORT_C int posix_spawn_file_actions_addclose(posix_spawn_file_actions_t* file_actions,
    1.86 +				int fid);
    1.87 +				
    1.88 +IMPORT_C int posix_spawn_file_actions_adddup2(posix_spawn_file_actions_t* file_actions,
    1.89 +				int fid1, int fid2);
    1.90 +				
    1.91 +IMPORT_C int posix_spawn_file_actions_addopen(posix_spawn_file_actions_t* file_actions,
    1.92 +          		int fid, const char* path, int oflag, mode_t mode);
    1.93 +          		
    1.94 +IMPORT_C int posix_spawn_file_actions_destroy(posix_spawn_file_actions_t* file_actions);
    1.95 +
    1.96 +IMPORT_C int posix_spawn_file_actions_init(posix_spawn_file_actions_t* file_actions);
    1.97 +
    1.98 +IMPORT_C int posix_spawnattr_destroy(posix_spawnattr_t* attrp);
    1.99 +
   1.100 +IMPORT_C int posix_spawnattr_getsigdefault(const posix_spawnattr_t* attrp, 
   1.101 +				sigset_t* sigdefault);
   1.102 +									
   1.103 +IMPORT_C int posix_spawnattr_getflags(const posix_spawnattr_t* attrp, short* flags);
   1.104 +
   1.105 +IMPORT_C int posix_spawnattr_getpgroup(const posix_spawnattr_t* attrp, pid_t* pgroup);
   1.106 +
   1.107 +IMPORT_C int posix_spawnattr_getschedparam(const posix_spawnattr_t* attrp,
   1.108 +          		struct sched_param* schedparam);
   1.109 +          		
   1.110 +IMPORT_C int posix_spawnattr_getschedpolicy(const posix_spawnattr_t* attrp, int* policy);
   1.111 +
   1.112 +IMPORT_C int posix_spawnattr_getsigmask(const posix_spawnattr_t* attrp, sigset_t* sigmask);
   1.113 +
   1.114 +IMPORT_C int posix_spawnattr_init(posix_spawnattr_t* attrp);
   1.115 +
   1.116 +IMPORT_C int posix_spawnattr_setsigdefault(posix_spawnattr_t* attrp,
   1.117 +				const sigset_t* sigdefault);
   1.118 +
   1.119 +IMPORT_C int posix_spawnattr_setflags(posix_spawnattr_t* attrp, short flags);
   1.120 +
   1.121 +IMPORT_C int posix_spawnattr_setpgroup(posix_spawnattr_t* attrp, pid_t pgroup);
   1.122 +
   1.123 +IMPORT_C int posix_spawnattr_setschedparam(posix_spawnattr_t* attrp,
   1.124 +				const struct sched_param* schedparam);
   1.125 +				
   1.126 +IMPORT_C int posix_spawnattr_setschedpolicy(posix_spawnattr_t* attrp, int policy);
   1.127 +
   1.128 +IMPORT_C int posix_spawnattr_setsigmask(posix_spawnattr_t* attrp, const sigset_t* sigmask);
   1.129 +          
   1.130 +__END_DECLS
   1.131 +
   1.132 +#endif /* _SPAWN_H_ */