1 /* Copyright (C) 2009 Trend Micro Inc.
4 * This program is a free software; you can redistribute it
5 * and/or modify it under the terms of the GNU General Public
6 * License (version 2) as published by the FSF - Free Software
10 /* Functions to handle operation with files */
17 #define OS_PIDFILE "/var/run"
19 /* Set the program name - must be done before *anything* else */
20 void OS_SetName(const char *name) __attribute__((nonnull));
22 time_t File_DateofChange(const char *file) __attribute__((nonnull));
24 int IsDir(const char *file) __attribute__((nonnull));
26 int CreatePID(const char *name, int pid) __attribute__((nonnull));
28 char *GetRandomNoise();
30 int DeletePID(const char *name) __attribute__((nonnull));
32 int MergeFiles(const char *finalpath, char **files) __attribute__((nonnull));
34 int MergeAppendFile(const char *finalpath, const char *files) __attribute__((nonnull(1)));
36 int UnmergeFiles(const char *finalpath, const char *optdir) __attribute__((nonnull(1)));
38 /* Daemonize a process */
41 /* Daemonize a process without closing stdin/stdout/stderr */
42 void goDaemonLight(void);
44 /* Not really a file operation, but returns the uname */
47 /* Return basename of path */
48 char *basename_ex(char *path) __attribute__((nonnull));
50 /* Rename file or directory */
51 int rename_ex(const char *source, const char *destination) __attribute__((nonnull));
53 /* Create temporary file */
54 int mkstemp_ex(char *tmp_path) __attribute__((nonnull));
56 /* Checks for Windows Vista */
62 int w_ref_parent_folder(const char * path);