Sponsored Content
Full Discussion: Entry Points Routine
Top Forums Programming Entry Points Routine Post 30356 by Perderabo on Monday 21st of October 2002 11:34:31 AM
Old 10-21-2002
Quote:
Originally posted by S.P.Prasad
Following is the cdevsw structure that we are using for developing stream device drivers in Sun and Sco unix Servers.
Well, I went looking for Sun's cdevsw. It took me several minutes to figure out why I can't find it. They don't have one. Sun uses a structure called cb_ops instead. (Are you getting your driver to compile on a Sun?? Which version of the OS?) But anyway, they do have full prototypes. The read entry is:
int (*cb_read)(dev_t dev, struct uio *uiop, Cred_t *credp)

However, the cb_ops table does indeed contain a pointer to a streamtab strucrure! I just called a friend of mine who has access to an SCO box. He mailed me his conf.h file and sure enough there is a pointer to a streamtab structure there. Like you, I don't understand what that pointer is for.

Looking at Sun's website, I found this SunOS streams-based pty driver and I can't believe what I see. They are setting cb_read and cb_write to nodev!! I can only guess that the read() system call will notice the "nodev" and the presence of the streamtab pointer and then do what is needed to invoke the read queue directly.

I don't understand this implementation but apparently, if you establish the proper streamtab and qinit structures it's gonna work on a Sun. And maybe that's how SCO works as well.

As originally posted by Perderabo
"No there no exception for streams-based character drivers. "
I guess I'll have to eat those words. It would seem to depend on the specific OS.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sub routine call

in windows machine... C:\2\test>perl -version This is perl, v5.6.1 built for MSWin32-x86-multi-thread (with 1 registered patch, see perl -V for more detail) ------------------------------------------ what is the difference b\w subroutine calls: sub_routine_name("-----"); and ... (2 Replies)
Discussion started by: sekar sundaram
2 Replies

2. UNIX and Linux Applications

Gnuplot question: how to plot 3D points as colored points in map view?

I have a simple gnuplot question. I have a set of points (list of x,y,z values; irregularly spaced, i.e. no grid) that I want to plot. I want the plot to look like this: - points in map view (no 3D view) - color of each point should depend on its z-value. - I want to define my own color scale -... (0 Replies)
Discussion started by: karman
0 Replies

3. UNIX for Advanced & Expert Users

how to cp files to dir,using routine?

hi all, I wanted to know how we can copy files to dirs, through a routine and when the file and the dir are specified as parameters for that routine and explicitly called? Eg: suppose i want to copy file1 to /tmp then myproc() { . . } myproc /path/file1 /tmp/ These parameters when... (1 Reply)
Discussion started by: wrapster
1 Replies

4. Shell Programming and Scripting

how to cp files to dir,using routine?

hi all, I wanted to know how we can copy files to dirs, through a routine and when the file and the dir are specified as parameters for that routine and explicitly called? Eg: suppose i want to copy file1 to /tmp then myproc() { . . } myproc /path/file1 /tmp/ These parameters when... (4 Replies)
Discussion started by: wrapster
4 Replies

5. Shell Programming and Scripting

File exists routine

Hello experts, I need some help here.. I've written the following routine to check for existence of files. The routine does the following. It will look for a compressed ( .Z ) file and if it exists, then it will uncompress it, if it is already uncompressed, then it will just diplay a message... (9 Replies)
Discussion started by: kamathg
9 Replies

6. Shell Programming and Scripting

awk routine help

Hi, I use awk but not as a programming language. Just generally in piplelines to split things out by fields. I am trying to accomplish this one thing that I think a short awk routine would do great for, but can't figure it out. Lets say I have a file that contains database columns. The file... (25 Replies)
Discussion started by: fwellers
25 Replies

7. Shell Programming and Scripting

Do not find the mistake in a small routine!!!

Have a textfile (regular updated) with informations about datafiles . Each line is describing a datafile. Now I am trying to delete several specific lines in this textfile, which are defined before in a kind of removal list. Can not find the mistake I have done in the script because in the... (5 Replies)
Discussion started by: jurgen
5 Replies

8. How to Post in the The UNIX and Linux Forums

Help me, write a bash script to delete parent entry with all their child entry in LDAP UNIX server

Hi All, Please help me and guide me to write a bash/shell script on Linux box to delete parent entry with all their child entries. example: Parent is : ---------- dn: email=yogesh.kumar@wipro.com, o=wipro, o=in child is: ---------- dn: cn: yogesh kumar, email=yogesh.kumar@wipro.com,... (1 Reply)
Discussion started by: Chand
1 Replies

9. Shell Programming and Scripting

Trying to Parse An Inherited Command/Routine

I am am one of these people that it isn't good enough just to say, "Here, try this...". it is important for me to understand how and why something works (or doesn't work.) All that being said, I am trying to parse out a command that we use that was handed down to me by someone I can no longer... (3 Replies)
Discussion started by: he204035
3 Replies

10. Shell Programming and Scripting

How to replace multiple "&nbsp;" entry with in <td> tag into single entry using sed?

I have the input file like this. Input file: 12.txt 1) There are one or more than one <tr> tags in same line. 2) Some tr tags may have one <td> or more tna one <td> tags within it. 3) Few <td> tags having "<td> &nbsp; </td>". Few having more than one "&nbsp;" entry in it. <tr> some td... (4 Replies)
Discussion started by: thomasraj87
4 Replies
cb_ops(9S)						    Data Structures for Drivers 						cb_ops(9S)

NAME
cb_ops - character/block entry points structure SYNOPSIS
#include <sys/conf.h> #include <sys/ddi.h> #include <sys/sunddi.h> INTERFACE LEVEL
Solaris DDI specific (Solaris DDI) DESCRIPTION
cb_ops contains all entry points for drivers that support both character and block entry points. All leaf device drivers supporting direct user process access to a device should declare a cb_ops structure. All drivers that safely allow multiple threads of execution in the driver at the same time must set the D_MP flag in the cb_flag field. If the driver properly handles 64-bit offsets, it should also set the D_64BIT flag in the cb_flag field. This specifies that the driver will use the uio_loffset field of the uio(9S) structure. mt-streams(9F) describes other flags that can be set in the cb_flag field. cb_rev is the cb_ops structure revision number. This field must be set to CB_REV. Non-STREAMS drivers should set cb_str to NULL. The following DDI/DKI or DKI-only or DDI-only functions are provided in the character/block driver operations structure. block/char Function Description b/c XXopen DDI/DKI b/c XXclose DDI/DKI b XXstrategy DDI/DKI b XXprint DDI/DKI b XXdump DDI(Sun) c XXread DDI/DKI c XXwrite DDI/DKI c XXioctl DDI/DKI c XXdevmap DDI(Sun) c XXmmap DKI c XXsegmap DKI c XXchpoll DDI/DKI c XXprop_op DDI(Sun) c XXaread DDI(Sun) c XXawrite DDI(Sun) STRUCTURE MEMBERS
int (*cb_open)(dev_t *devp, int flag, int otyp, cred_t *credp); int (*cb_close)(dev_t dev, int flag, int otyp, cred_t *credp); int (*cb_strategy)(struct buf *bp);int(*cb_print)(dev_t dev, char *str); int (*cb_dump)(dev_t dev, caddr_t addr, daddr_t blkno, int nblk); int (*cb_read)(dev_t dev, struct uio *uiop, cred_t *credp); int (*cb_write)(dev_t dev, struct uio *uiop, cred_t *credp); int (*cb_ioctl)(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, int *rvalp); int (*cb_devmap)(dev_t dev, devmap_cookie_t dhp, offset_t off, size_t len, size_t *maplen, uint_t model); int (*cb_mmap)(dev_t dev, off_t off, int prot); int (*cb_segmap)(dev_t dev, off_t off, struct as *asp, caddr_t *addrp, off_t len, unsigned int prot, unsigned int maxprot, unsigned int flags, cred_t *credp); int (*cb_chpoll)(dev_t dev, short events, int anyyet, short *reventsp, struct pollhead **phpp); int (*cb_prop_op)(dev_t dev, dev_info_t *dip, ddi_prop_op_t prop_op, int mod_flags, char *name, caddr_t valuep, int *length); struct streamtab *cb_str; /* streams information */ int cb_flag; int cb_rev; int (*cb_aread)(dev_t dev, struct aio_req *aio, cred_t *credp); int (*cb_awrite)(dev_t dev, struct aio_req *aio, cred_t *credp); SEE ALSO
aread(9E), awrite(9E), chpoll(9E), close(9E), dump(9E), ioctl(9E), mmap(9E), open(9E), print(9E), prop_op(9E), read(9E), segmap(9E), strat- egy(9E), write(9E), nochpoll(9F), nodev(9F), nulldev(9F), dev_ops(9S), qinit(9S) Writing Device Drivers STREAMS Programming Guide SunOS 5.10 30 Sep 1996 cb_ops(9S)
All times are GMT -4. The time now is 02:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy