Originally posted by S.P.Prasad I just cannot figure it out then why,as I have stated "The declaration within the table contains information in the structure "see dev switch" has a member variable of type pointer to struct streamtab.
As far as I know, it doesn't; and you are in error if you think it does. Here is cdevsw from HP-UX 11.0:
To use d_read as an example, The type of d_read is:
typedef int (*d_read_t) __((dev_t dev, struct uio *uio));
And that typedef does not magically change into a pointer to a qinit structure if the current entry happens to be a streams based driver. Any time the read or readv system call invokes the read routine of a character driver, that read routine is passed a device and a uio structure. Every read of a character device is treated this way. No there no exception for streams-based character drivers.
The cdevsw for osf1 is similiar but with much less type checking:
Without strong typechecking it's hard to prove exactly what d_read is. But that DDI/DKI stands for Device Driver Interface/Driver Kernel Interface. You can be sure that a system that supports that standard is not going to turn d_read into a pointer to a qinit structure.
If you post again claiming that your cdevsw has pointers to qinit (or other stream) structures, please also post some evidence as well. I would also like to know which stream structure you think that your d_ioctl points to.
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)
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)
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)
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)
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)
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)
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)
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)
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)
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> </td>". Few having more than one " " entry in it.
<tr> some td... (4 Replies)
Discussion started by: thomasraj87
4 Replies
LEARN ABOUT CENTOS
strategy
strategy(9E) Driver Entry Points strategy(9E)NAME
strategy - perform block I/O
SYNOPSIS
#include <sys/types.h>
#include <sys/buf.h>
#include <sys/ddi.h>
#include <sys/sunddi.h>
int prefixstrategy(struct buf *bp);
INTERFACE LEVEL
Architecture independent level 1 (DDI/DKI). This entry point is required for block devices.
PARAMETERS
bp Pointer to the buf(9S) structure.
DESCRIPTION
The strategy() routine is called indirectly (through cb_ops(9S)) by the kernel to read and write blocks of data on the block device. strat-
egy() may also be called directly or indirectly to support the raw character interface of a block device (read(9E), write(9E) and
ioctl(9E)). The strategy() routine's responsibility is to set up and initiate the transfer.
In general, strategy() should not block. It can, however, perform a kmem_cache_alloc(9F) with both the KM_PUSHPAGE and KM_SLEEP flags set,
which might block, without causing deadlock in low memory situations.
RETURN VALUES
The strategy() function must return 0. On an error condition, it should call bioerror(9f) to set b_flags to the proper error code, and call
biodone(9f). Note that a partial transfer is not considered to be an error.
SEE ALSO ioctl(9E), read(9E), write(9E), biodone(9F), bioerror(9F), buf(9S), cb_ops(9S), kmem_cache_alloc(9F)
Writing Device Drivers
SunOS 5.10 6 Nov 2003 strategy(9E)