renamed AppRoot to App

added App::setSignalHandler() and App::unsetSignalHandler()
This commit is contained in:
2018-07-20 08:48:33 +00:00
parent f6c51b1a67
commit 7755914a2c
10 changed files with 150 additions and 70 deletions

View File

@ -786,6 +786,9 @@
/* The size of `MB_LEN_MAX', as computed by valueof. */
#undef NUMVALOF_MB_LEN_MAX
/* The size of `NSIG', as computed by valueof. */
#undef NUMVALOF_NSIG
/* The size of `PATH_MAX', as computed by valueof. */
#undef NUMVALOF_PATH_MAX
@ -871,6 +874,9 @@
/* Define if mode_t is signed */
#undef QSE_MODE_T_IS_SIGNED
/* NSIG */
#undef QSE_NSIGS
/* offsetof(struct iovec, iov_base) */
#undef QSE_OFFSETOF_IOV_BASE

View File

@ -24,8 +24,8 @@
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _QSE_SI_APPROOT_H_
#define _QSE_SI_APPROOT_H_
#ifndef _QSE_SI_APP_H_
#define _QSE_SI_APP_H_
#include <qse/Types.hpp>
#include <qse/Uncopyable.hpp>
@ -35,11 +35,11 @@
QSE_BEGIN_NAMESPACE(QSE)
/////////////////////////////////
class AppRoot: public Uncopyable, public Types, public Mmged
class App: public Uncopyable, public Types, public Mmged
{
public:
AppRoot (Mmgr* mmgr): Mmged(mmgr), _root_only(false) {}
virtual ~AppRoot () {}
App (Mmgr* mmgr) QSE_CPP_NOEXCEPT: Mmged(mmgr), _root_only(false) {}
~App () QSE_CPP_NOEXCEPT {}
int daemonize (bool chdir_to_root = true, int fork_count = 1) QSE_CPP_NOEXCEPT;
@ -53,15 +53,12 @@ public:
protected:
bool _root_only;
#if 0
uid_t saved_uid;
gid_t saved_gid;
gid_t saved_groups[NGROUPS_MAX];
qse_size_t saved_ngroups;
void on_signal () QSE_CPP_NOEXCEPT;
void on_signal () QSE_CPP_NOEXCEPT;
#endif
public:
typedef void (*SignalHandler) (int sig);
static int setSignalHandler (int sig, SignalHandler sighr);
static int unsetSignalHandler (int sig);
static qse_size_t _sighrs[2][QSE_NSIGS];
};
/////////////////////////////////

View File

@ -29,7 +29,7 @@ pkginclude_HEADERS = \
if ENABLE_CXX
pkginclude_HEADERS += \
AppRoot.hpp \
App.hpp \
Condition.hpp \
Mutex.hpp \
SocketAddress.hpp \

View File

@ -88,7 +88,7 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
@ENABLE_CXX_TRUE@am__append_1 = \
@ENABLE_CXX_TRUE@ AppRoot.hpp \
@ENABLE_CXX_TRUE@ App.hpp \
@ENABLE_CXX_TRUE@ Condition.hpp \
@ENABLE_CXX_TRUE@ Mutex.hpp \
@ENABLE_CXX_TRUE@ SocketAddress.hpp \
@ -136,7 +136,7 @@ am__can_run_installinfo = \
am__pkginclude_HEADERS_DIST = aio.h aio-pro.h aio-sck.h cnd.h dir.h \
fio.h fs.h glob.h intr.h log.h mtx.h mux.h nwad.h nwif.h \
nwio.h os.h pio.h rwl.h sck.h sinfo.h sio.h spl.h task.h thr.h \
tio.h AppRoot.hpp Condition.hpp Mutex.hpp SocketAddress.hpp \
tio.h App.hpp Condition.hpp Mutex.hpp SocketAddress.hpp \
Socket.hpp SpinLock.hpp TcpServer.hpp Thread.hpp
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \