7rx8 commented on code in PR #3192:
URL: https://github.com/apache/nuttx-apps/pull/3192#discussion_r2454643834


##########
system/init/service.h:
##########
@@ -0,0 +1,138 @@
+/****************************************************************************
+ * apps/system/init/service.h
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __APPS_SYSTEM_INIT_SERVICE_H
+#define __APPS_SYSTEM_INIT_SERVICE_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/list.h>
+
+#include <stdint.h>
+#include <sys/types.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Ref to Android Init
+ * URL: https://android.googlesource.com/platform/system/core/+/
+ *      android16-release/init/service.h#42
+ */
+#define SVC_DISABLED    (1 << 0)  /* do not autostart with class */
+#define SVC_ONESHOT     (1 << 1)  /* do not restart on exit */
+#define SVC_RUNNING     (1 << 2)  /* currently active */
+#define SVC_RESTARTING  (1 << 3)  /* waiting to restart */
+
+/* This service should be stopped with SIGTERM instead of SIGKILL.
+ * Will still be SIGKILLed after timeout period of 200 ms.
+ */
+
+#define SVC_GENTLE_KILL (1 << 13)
+
+/* Flags below are new added.
+ */
+
+/* Override the previous definition for a service with the same name */
+
+#define SVC_OVERRIDE    (1 << 29)
+
+/* Already sent SIGKILL, and should not send again. */
+
+#define SVC_SIGKILL     (1 << 30)
+
+/* Should be removed immediately after stopped */
+
+#define SVC_REMOVE      (1 << 31)
+
+/****************************************************************************
+ * Public Types
+ ****************************************************************************/
+
+struct service_class_s
+{
+  struct list_node node;

Review Comment:
   for consistency you should document the expected structs everywhere.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to