2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.tizenopensource.org/license
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
24 #include "ss_sig_handler.h"
25 #include "ss_device_handler.h"
26 #include "ss_pmon_handler.h"
27 #include "ss_sysnoti.h"
30 #include "ss_predefine.h"
32 #include "ss_procmgr.h"
33 #include "ss_timemgr.h"
34 #include "ss_cpu_handler.h"
35 #include "ss_device_plugin.h"
36 #include "include/ss_data.h"
38 static void fini(struct ss_main_data *ad)
42 static void init_ad(struct ss_main_data *ad)
44 memset(ad, 0x0, sizeof(struct ss_main_data));
47 static void writepid(char *pidpath)
51 fp = fopen(pidpath, "w");
53 fprintf(fp, "%d", getpid());
58 static void system_server_init(struct ss_main_data *ad)
60 if (0 > _ss_devman_plugin_init()) {
61 PRT_TRACE_ERR("Device Manager Plugin Initialize failed");
65 ad->sysnoti_fd = ss_sysnoti_init();
66 if (ss_noti_init() < 0)
67 PRT_TRACE_ERR("init noti error");
72 ss_predefine_internal_init();
73 ss_process_manager_init();
74 ss_time_manager_init();
75 ss_cpu_handler_init();
82 ss_device_change_init(ad);
85 _ss_usb_storage_init();
88 #define SS_PIDFILE_PATH "/var/run/.system_server.pid"
90 static int system_main(int argc, char **argv)
92 struct ss_main_data ad;
95 ad.noti_fd = heynoti_init();
96 heynoti_attach_handler(ad.noti_fd);
97 system_server_init(&ad);
99 ecore_main_loop_begin();
107 static int elm_main(int argc, char **argv)
109 return system_main(argc, argv);
112 int main(int argc, char **argv)
114 writepid(SS_PIDFILE_PATH);
116 return elm_main(argc, argv);