Files
neon/pgxn/neon_walredo/neon_seccomp.h
Heikki Linnakangas 22cc8760b9 Move walredo process code under pgxn in the main 'neon' repository.
- Refactor the way the WalProposerMain function is called when started
  with --sync-safekeepers. The postgres binary now explicitly loads
  the 'neon.so' library and calls the WalProposerMain in it. This is
  simpler than the global function callback "hook" we previously used.

- Move the WAL redo process code to a new library, neon_walredo.so,
  and use the same mechanism as for --sync-safekeepers to call the
  WalRedoMain function, when launched with --walredo argument.

- Also move the seccomp code to neon_walredo.so library. I kept the
  configure check in the postgres side for now, though.
2022-10-31 01:11:50 +01:00

23 lines
593 B
C

#ifndef NEON_SECCOMP_H
#define NEON_SECCOMP_H
#include <seccomp.h>
typedef struct {
int psr_syscall; /* syscall number */
uint32 psr_action; /* libseccomp action, e.g. SCMP_ACT_ALLOW */
} PgSeccompRule;
#define PG_SCMP(syscall, action) \
(PgSeccompRule) { \
.psr_syscall = SCMP_SYS(syscall), \
.psr_action = (action), \
}
#define PG_SCMP_ALLOW(syscall) \
PG_SCMP(syscall, SCMP_ACT_ALLOW)
extern void seccomp_load_rules(PgSeccompRule *syscalls, int count);
#endif /* NEON_SECCOMP_H */