Soletta™ Framework
Framework for making IoT devices

Full online documentation | C API Index
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
sol-platform-linux.h
Go to the documentation of this file.
1 /*
2  * This file is part of the Soletta (TM) Project
3  *
4  * Copyright (C) 2015 Intel Corporation. All rights reserved.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 
19 #pragma once
20 
21 #include <stdbool.h>
22 #include <stdint.h>
23 
24 #include "sol-macros.h"
25 #include "sol-platform.h"
26 #include "sol-str-slice.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
86 struct sol_platform_linux_fork_run *sol_platform_linux_fork_run(void (*on_fork)(void *data), void (*on_child_exit)(void *data, uint64_t pid, int status), const void *data);
87 
110 
111 
125 
137 
154 
166 int sol_platform_linux_mount(const char *dev, const char *mpoint, const char *fstype, void (*cb)(void *data, const char *mpoint, int status), const void *data);
167 
174 typedef struct sol_uevent {
180 } sol_uevent;
181 
192 int sol_platform_linux_uevent_subscribe(const char *action, const char *subsystem, void (*cb)(void *data, struct sol_uevent *uevent), const void *data);
193 
204 int sol_platform_linux_uevent_unsubscribe(const char *action, const char *subsystem, void (*cb)(void *data, struct sol_uevent *uevent), const void *data);
205 
206 #ifdef __cplusplus
207 }
208 #endif
#define SOL_ATTR_NO_RETURN
Used to tell that a function never return.
Definition: sol-macros.h:198
int sol_platform_linux_fork_run_stop(struct sol_platform_linux_fork_run *handle)
Force the child process to stop running and wait for it.
int sol_platform_linux_mount(const char *dev, const char *mpoint, const char *fstype, void(*cb)(void *data, const char *mpoint, int status), const void *data)
Mounts a device in a specific location.
int sol_platform_linux_uevent_subscribe(const char *action, const char *subsystem, void(*cb)(void *data, struct sol_uevent *uevent), const void *data)
Subscribe to monitor linux's uevent events.
struct sol_str_slice modalias
The alias.
Definition: sol-platform-linux.h:175
These are common Soletta macros.
int sol_platform_linux_fork_run_send_signal(struct sol_platform_linux_fork_run *handle, int sig)
Send a signal to the child process.
struct sol_platform_linux_fork_run * sol_platform_linux_fork_run(void(*on_fork)(void *data), void(*on_child_exit)(void *data, uint64_t pid, int status), const void *data)
Fork a new process and run the given on_fork callback on that process.
String slice type.
Definition: sol-str-slice.h:84
struct sol_str_slice action
The uevent action.
Definition: sol-platform-linux.h:176
uint64_t sol_platform_linux_fork_run_get_pid(const struct sol_platform_linux_fork_run *handle)
The process identifier of this child.
Struct that contains information about an uevent.
Definition: sol-platform-linux.h:174
struct sol_str_slice subsystem
The event subsystem.
Definition: sol-platform-linux.h:177
struct sol_str_slice devtype
The device type.
Definition: sol-platform-linux.h:178
These are routines that Soletta provides for its string slice implementation.
struct sol_str_slice devname
The device name.
Definition: sol-platform-linux.h:179
These routines are used for Soletta platform interaction.
void sol_platform_linux_fork_run_exit(int status) SOL_ATTR_NO_RETURN
Exit from a child process.
struct sol_uevent sol_uevent
Struct that contains information about an uevent.
int sol_platform_linux_uevent_unsubscribe(const char *action, const char *subsystem, void(*cb)(void *data, struct sol_uevent *uevent), const void *data)
Unsubscribe uevent_cb() for action and subsystem events monitoring.