Project

General

Profile

Actions

Bug #9903

closed

qinfo: add typed members

Added by Toomas Soome over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
driver - device drivers
Start date:
2018-10-16
Due date:
% Done:

100%

Estimated time:
Difficulty:
Hard
Tags:
Gerrit CR:

Description

The STREAMS struct qinfo does define the qinit(9s) procedures, unfortunately in our case, without proper types. This is bad because without the proper function types, our compiler is unable to help us to identify the bugs. In this update we add proper types and fix the issues identified by gcc 4.4.4-il and gcc 7. The patch will allow us to identify more issues with gcc 8, because gcc 8 does perform better function signature checks.

Functions:

typedef int (*qi_putp_t)(queue_t *, mblk_t *);
use case: http://src.illumos.org/source/xref/illumos-gate/usr/src/uts/common/os/strsubr.c#6777

typedef int (*qi_srvp_t)(queue_t *);
use case: http://src.illumos.org/source/xref/illumos-gate/usr/src/uts/common/os/strsubr.c#3655

typedef int (*qi_qopen_t)(queue_t *, dev_t *, int, int, cred_t *);
use case: http://src.illumos.org/source/xref/illumos-gate/usr/src/uts/common/os/strsubr.c#1200

typedef int (*qi_qclose_t)(queue_t *, int, cred_t *);
use case: http://src.illumos.org/source/xref/illumos-gate/usr/src/uts/common/os/strsubr.c#1280

typedef int (*qi_qadmin_t)(void);
only defined as qinfo member, not used anywhere.

typedef int (*qi_rwp_t)(queue_t *, struiod_t *);
local var setup: http://src.illumos.org/source/xref/illumos-gate/usr/src/uts/common/io/stream.c#3787
use case: http://src.illumos.org/source/xref/illumos-gate/usr/src/uts/common/io/stream.c#3869

typedef int (*qi_infop_t)(queue_t *, infod_t *);
local var setup: http://src.illumos.org/source/xref/illumos-gate/usr/src/uts/common/io/stream.c#3962
use case: http://src.illumos.org/source/xref/illumos-gate/usr/src/uts/common/io/stream.c#3989

And finally, see also: http://www.openss7.net/man2html?qinit(9)


Related issues

Related to illumos gate - Bug #9901: ip: rts_wput_other: this statement may fall throughClosedToomas Soome2018-10-16

Actions
Related to illumos gate - Bug #9900: fcip: debug statement is mixed upClosedToomas Soome

Actions
Related to illumos gate - Bug #9902: mac: mac_soft_ring_poll should use size_tClosedToomas Soome

Actions
Actions #1

Updated by Toomas Soome over 2 years ago

  • Parent task changed from #9900 to #9902
Actions #2

Updated by Toomas Soome over 2 years ago

  • Related to Bug #9901: ip: rts_wput_other: this statement may fall through added
Actions #3

Updated by Toomas Soome over 2 years ago

  • Related to Bug #9900: fcip: debug statement is mixed up added
Actions #4

Updated by Toomas Soome over 2 years ago

  • Parent task deleted (#9902)
Actions #5

Updated by Toomas Soome over 2 years ago

  • Related to Bug #9902: mac: mac_soft_ring_poll should use size_t added
Actions #6

Updated by Toomas Soome over 2 years ago

  • Description updated (diff)
Actions #7

Updated by Electric Monk over 2 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

git commit 5e1743f0d6a1d79ccc247d50153ad830fa07768b

commit  5e1743f0d6a1d79ccc247d50153ad830fa07768b
Author: Toomas Soome <tsoome@me.com>
Date:   2018-11-26T16:11:27.000Z

    9903 qinfo: add typed members
    Reviewed by: Dan McDonald <danmcd@joyent.com>
    Reviewed by: Hans Rosenfeld <hans.rosenfeld@joyent.com>
    Reviewed by: Garrett D'Amore <garrett@damore.org>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF