static BOOL allowable_number_of_smbd_processes(void) { int max_processes = lp_max_smbd_processes(); if (!max_processes) return True; { TDB_CONTEXT *tdb = conn_tdb_ctx(); int32 val; if (!tdb) { DEBUG(0,("allowable_number_of_smbd_processes: can't open connection tdb.\n" )); return False; } val = tdb_fetch_int32(tdb, "INFO/total_smbds"); if (val == -1 && (tdb_error(tdb) != TDB_ERR_NOEXIST)) { DEBUG(0,("allowable_number_of_smbd_processes: can't fetch INFO/total_smbds. Error %s\n", tdb_errorstr(tdb) )); return False; } if (val > max_processes) { DEBUG(0,("allowable_number_of_smbd_processes: number of processes (%d) is over allowed limit (%d)\n", val, max_processes )); return False; } } return True; }
static bool allowable_number_of_smbd_processes(void) { int max_processes = lp_max_smbd_processes(); if (!max_processes) return True; return num_children < max_processes; }
static bool allowable_number_of_smbd_processes(struct smbd_parent_context *parent) { int max_processes = lp_max_smbd_processes(); if (!max_processes) return True; return parent->num_children < max_processes; }