/* *************************************************************************** * Find number of serial lines that support tx/rx accounting * in /proc/tty/driver/serial file. * * IN: * @a Activity structure. * * RETURNS: * Number of serial lines supporting tx/rx accouting + a pre-allocation * constant. *************************************************************************** */ __nr_t wrap_get_serial_nr(struct activity *a) { __nr_t n = 0; if ((n = get_serial_nr()) > 0) return n + NR_SERIAL_PREALLOC; return 0; }
/* *************************************************************************** * Find number of serial lines that support tx/rx accounting * in /proc/tty/driver/serial file. * * IN: * @a Activity structure. * * RETURNS: * Number of serial lines supporting tx/rx accouting + a pre-allocation * constant. Number cannot exceed MAX_NR_SERIAL_LINES. *************************************************************************** */ __nr_t wrap_get_serial_nr(struct activity *a) { __nr_t n = 0; if ((n = get_serial_nr()) > 0) { if ((n + NR_SERIAL_PREALLOC) > MAX_NR_SERIAL_LINES) return MAX_NR_SERIAL_LINES; else return n + NR_SERIAL_PREALLOC; } return 0; }