* pgpool: a language independent connection pool server for PostgreSQL
* written by Tatsuo Ishii
*
- * Copyright (c) 2003-2017 PgPool Global Development Group
+ * Copyright (c) 2003-2021 PgPool Global Development Group
*
* Permission to use, copy, modify, and distribute this software and
* its documentation for any purpose and without fee is hereby
/*
* Return byte size of connection info(ConnectionInfo) on shmem.
*/
-int pool_coninfo_size(void)
+size_t
+pool_coninfo_size(void)
{
- int size;
+ size_t size;
+
size = pool_config->num_init_children *
pool_config->max_pool *
MAX_NUM_BACKENDS *
sizeof(ConnectionInfo);
ereport(DEBUG1,
- (errmsg("pool_coninfo_size: num_init_children (%d) * max_pool (%d) * MAX_NUM_BACKENDS (%d) * sizeof(ConnectionInfo) (%zu) = %d bytes requested for shared memory",
+ (errmsg("pool_coninfo_size: num_init_children (%d) * max_pool (%d) * MAX_NUM_BACKENDS (%d) * sizeof(ConnectionInfo) (%zu) = %zu bytes requested for shared memory",
pool_config->num_init_children,
pool_config->max_pool,
MAX_NUM_BACKENDS,
* pgpool: a language independent connection pool server for PostgreSQL
* written by Tatsuo Ishii
*
- * Copyright (c) 2003-2015 PgPool Global Development Group
+ * Copyright (c) 2003-2021 PgPool Global Development Group
*
* Permission to use, copy, modify, and distribute this software and
* its documentation for any purpose and without fee is hereby
extern POOL_PROCESS_CONTEXT *pool_get_process_context(void);
extern ProcessInfo *pool_get_my_process_info(void);
extern void pool_incremnet_local_session_id(void);
-extern int pool_coninfo_size(void);
extern int pool_coninfo_num(void);
extern ConnectionInfo *pool_coninfo(int child, int connection_pool, int backend);
extern ConnectionInfo *pool_coninfo_pid(int pid, int connection_pool, int backend);
+extern size_t pool_coninfo_size(void);
extern void pool_coninfo_set_frontend_connected(int proc_id, int pool_index);
extern void pool_coninfo_unset_frontend_connected(int proc_id, int pool_index);
* pgpool: a language independent connection pool server for PostgreSQL
* written by Tatsuo Ishii
*
- * Portions Copyright (c) 2003-2011, PgPool Global Development Group
+ * Portions Copyright (c) 2003-2021, PgPool Global Development Group
* Portions Copyright (c) 2003-2004, PostgreSQL Global Development Group
*
* Permission to use, copy, modify, and distribute this software and
if (shmid < 0)
ereport(FATAL,
- (errmsg("could not create shared memory for request size: %ld",size),
- errdetail("shared memory creation failed with error \"%s\"",strerror(errno))));
+ (errmsg("could not create shared memory for request size: %zu", size),
+ errdetail("shared memory creation failed with error \"%m\"")));
/* Register on-exit routine to delete the new segment */
on_shmem_exit(IpcMemoryDelete, shmid);