1 /* 2 * Process-related convenience functions and types. 3 * 4 * Copyright (C) 2023 Paul Boddie <paul@boddie.org.uk> 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License as 8 * published by the Free Software Foundation; either version 2 of 9 * the License, or (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 * Boston, MA 02110-1301, USA 20 */ 21 22 #pragma once 23 24 #include <l4/sys/types.h> 25 26 #include <fsclient/file.h> 27 #include <systypes/base.h> 28 29 30 31 EXTERN_C_BEGIN 32 33 /* File access abstraction compatible with notifiable_base_t. */ 34 35 typedef struct 36 { 37 /* File object reference. */ 38 39 l4_cap_idx_t ref; 40 41 /* Notification structure. */ 42 43 notifiable_t notifiable; 44 45 } process_t; 46 47 48 49 /* Principal functions. */ 50 51 process_t *process_new(); 52 void process_close(process_t *process); 53 long process_error(process_t *process); 54 void process_init(process_t *process); 55 long process_start(process_t *process, int argc, const char *argv[]); 56 57 /* Notification support. */ 58 59 notifiable_t *process_notifiable(process_t *process); 60 notify_flags_t process_notifications(process_t *process); 61 notify_values_t process_notification_values(process_t *process); 62 63 long process_notify_wait_process(process_t *process, notifier_t *notifier); 64 long process_notify_wait_processes(process_t **process, notifier_t *notifier); 65 66 EXTERN_C_END 67 68 // vim: tabstop=2 expandtab shiftwidth=2