How to determine which file descriptor opened my driver?

Suppose a user process opens my driver twice. How does open() determine which file descriptor opened the device? In Linux, the kernel will pass a pointer to a structure which represents the open file descriptor. However, Solaris only passes the device number to open(), so I can only determine my device was opened, but not which file. I need this information because my driver needs to keep track of all file descriptors opened for the device.
Thanks!
-Darren

I'm still at a loss why you need to know the file descriptor value (unless the app is sufficiently spaghettied that it has to query the driver to figure out what it opened with what). It's like asking what filename was used to open the device (which you can't get either). Since Solaris is based on a Streams framework, it would be bad to have drivers to even think it has a direct mapping into user space. It would be the same in asking (using /bin/sh):
prog3 4>&1 3>&1 2>&1 | prog2 | prog1
and you want to know from prog1 what descriptor prog3 wrote to. I don't see how linux even does this properly, since any given file open can have multiple file descriptors (via dup).

Similar Messages

  • How to see which files are open on shares

    Im fairly new to OS X Server. Am running OS X Server 10.6.8
    How can i see files that are open through AFP or SMB? I've tried the command lsof but that doesnt seem to show open files through network.

    Try smbstatus.
    To pin down exactly which files are locked for use, try:
    smbstatus | grep -i deny_write
    For AFP, I'm not sure exactly how it's done -- there isn't an afpstatus command, so I'm a bit in the dark. However, you could probably use a combination of lsof and grep to find any objects of type REG and owned by applefile.
    Maybe this:
    sudo lsof | grep -i "^applefile" | grep REG
    But that will return everything in use by the AppleFile service. From there, though, one may need to be familiar with what shares are on the system to further deduce what's open. For example, I get 10 lines returned, but only one of them contains a known share name (/Users/username/path/to/file), the rest are system directories (/System, /private, /usr, /Library and the like).
    Hope this helps a bit.

  • How to Determine Which Workspaces Are Open

    We are currently doing some Git automation in which all developer work folders will get updated automatically. However, the automation script should skip a developer folder if CVI is open from that folder. For example, assume there are three folders.
    c:\dev1\myproj.prj
    c:\dev2\myproj.prj
    c:\dev3\myproj.prj
    If dev2 has myproj.prj open, the script will skip that folder. The way we tried to determine if a particular project is open is as follows:
    1. Determine if CVI process is running.
    2. If yes, get CVI window title.
    We wrote a Win32 C++ utility for this purpose. Since the title shows the full workspace path, this information was sufficient. But recently, we noticed that if the path is too long, CVI shortens it (eg: c:\..\folder\myproj.prj). At the same time, if I hover the mouse on the title bar area, CVI shows a tool tip with the full path.
    So I was wondering if there is any way I can read the tool tip string? Suggestions on approaching this in some other way are also welcome.
    Solved!
    Go to Solution.

    You could use ActiveX automation to connect to a running instance of CVI to find out what the current project is.
    Once you determine that an instannce of CVI is running, you can then call CVI_ActiveApp to connect to it (look at samples\activex\cvi\build.prj if you're not familiar with ActiveX automattion). The one caveat is that it's hard to control which instance of CVI will be used by CVI_ActiveApp, in case more than one is running. But you can always also use the CVI_AppGetCVIProcessId function to confirm that you have the right one (whatever the "right one" means, in that case).
    Once you have a connection, then you can use CVI_AppGetCurrentProject.
    Luis

  • How to determine the file system on Solaris

    Friends,
    How to determine which file system I have installed UFS or ZFS on Solaris
    Thanks

    Other methods would include looking at the /etc/vfstab if it's in there or fstyp(1M):
    System Administration Commands fstyp(1M)
    NAME
    fstyp - determine file system type
    SYNOPSIS
    fstyp [-a | -v] special [:logical-drive]

  • How do you tell which files are open in bridge cs5?

    In adobe bridge for CS2, open files in Photoshop show an icon in the lower right corner of the bridge thumnail. This is really helpful in sorting if you have a lot of files open. I can't figure out how to tell in bridge CS5 which files are open in photoshop. Is there a menu option that controls this??

    Thanks for the reply. This is a useful feature but not quite what I need.
    I am sorting through 2000 wedding photos. I have maybe 10 versions of the same shot open at a time. I edit, save, and close 2-3 of them. In CS2, I would go back to bridge and I could see the 7 files still open. I could quickly highlight and delete them. I'm trying to find a way to do something similar in CS5 bridge. Right now, I take the ones I'm going to delete and stack them all. But when I go back to bridge to delete them, I have to look at file numbers to see which ones are in the stack that I want to delete. This really slows my work flow. Any suggestions? Can I delete them directly from Photoshop?

  • How can I access files from a flash drive that were previously saved using a Windows computer? When I attempt to open the file on MacBook Pro, it is asking to "convert file to"; I also have Microsoft Word installed on the Mac as well.

    How can I access files from a flash drive that were previously saved using a Windows computer? When I attempt to open the file on MacBook Pro, it is asking to "convert file to"; none of the options I choose work. I also have Microsoft Office (with Word) installed on the Mac as well.

    Format the external drive as FAT32 or ExFAT. Both computers will then be able to read and write to it.

  • Semantics File Sender Adapter to determine which files to retrieve

    Hallo,
    does anybody has experience with this semantic?
    Thanks in advance,
    Frank
    From the FAQ-List of file-adapter(Note 821267 , Question 27).
    Q: Which semantics does the File Sender Adapter apply to determine which files to retrieve from an FTP server?
    A: Up to and including SP13 the File Adapter will issue an NLST command (see RFC 959) with the configured source file name scheme as first parameter to the FTP server. It will try to retrieve any of the files returned by the FTP server in response to this command.
    Starting with SP14, the File Adapter will issue a LIST command with the configured source file name scheme as first parameter to the FTP server. If it is able to parse the returned result (which is the case for UNIX- and Windows-style directory listings), it will retrieve any of the returned files. If it cannot parse the result, it will fall back to the pre-SP14 implementation and use the NLST command as described above.

    Frank
    We are on SP12 and have had problems with this and specifically, the FTP server on Solaris, not being fully RFC959 compliant.
    We've had to get a different FTP Server as we were returned *.xml no file or folder found instead of 550 *.xml no file or folder found.
    This increased the polling to the server, and filled up the ftp logging file, which intern filled up the partition and crasehd the server.
    We got round this by installing http://www.proftpd.org/

  • How to determine which elements are queryable via Web Services QueryPage

    I am trying to query opportunities by associated opportunity product revenue records, but I continue to receive errors like "Unexpected text: = '9598015'".
    From reviewing the forums, it looks like this is when I am querying a field that is not defined to be queryable.
    Could someone please tell me how to determine which fields are queryable on a particular record type like this? I have tried using basic short text fields and indexed short text fields - but continue to receive the error message above.
    Thanks in advance.

    I found at least partial answers to my questions.
    MessageContext.getPropertyNames() can be used to see the properties on a given flow.
    MessageContext.getProperty(prop) can be used to get information for paroperties such as:
    prop=javax.xml.rpc.service.endpoint.address
    prop=wsdl.portName
    -- Frank

  • How to determine which chipset my Satellite L300/700 has?

    I have a SATELLITE L300/700 (PSLB8A-047004). The User Guide covers several models. It indicates that the chipset determines which memory modules I need for a memory upgrade. How do I find out which chipset I have, please?
    Kev.

    > I'm still curious about how to determine which chipset I have - any thoughts?
    Go to the device manger and click on IDE Ata/Atapi controllers:
    http://img814.imageshack.us/img814/7321/chipset.jpg
    There you will see your chipset installed on your laptop. In my case, as shown on the screenshot is Intel ICH9m

  • How to make pdf file auto open with adobe reader after downloaded

    how to make pdf file auto open with adobe reader after downloaded

    I note from your system details that you have the plugin for adobe pdf s so I would have expected the files should open in firefox '''without''' you needing to explicitly download them.
    Once the files are open in firefox, you will also get the option to save them permanently to a location on your computer. If you wish I suppose you could set the file type pdf to be associated with and be opened by firefox instead of with the Adobe Acrobat Reader, but that would just seem to be an additional complexity.

  • How can I get files to open automatically upon download?

    I would like files I download to open automatically and for the download window to be turned off. I know how to turn off the download window, but cannot get files to automatically download.

    Hi JJMack. Thanks for getting back to me.
    I think I've created confusion about what I want. All I want is to end up with a file that is flattened so that I can save it as a tiff without getting a warning that it contains layers. Please correct me if I’m wrong but I’ve always assumed I should always flatten a file before I save it as a tiff unless I specifically want to retain layers or transparency. I’m only talking here of files that open with a single layer: ie. Layer 1. I assume that if I don’t flatten such files the resultant files will be unnecessarily big?
    The only reason I keep saying I want a Background layer is that I know that a flattened file will only have a Background layer. I don’t have any desire for a Background layer per se. I certainly don’t want to add extra layers - quite the opposite.
    So perhaps the question I should have asked should have been:
    How can I get files to open 'ready-flattened' by default so I can save them directly to tiff without having to manually flatten them every time?
    Cheers

  • Changing which files are opened automatically when opening a solution

    When I open a solution, VS automatically opens various files in the editor.   There must be a configuration setting somewhere in the solution that tells VS which files to open but I'm unable to find that setting.  Anyone know where this setting
    can be found?

    It's in the .suo file.
    If you have a Foo.sln then you will also have a (hidden) Foo.v12.suo file and that's where this information is stored.
    The .suo is a binary file in an undisclosed format.
    Solution User Options, I believe, is what .suo stands for.  (At least, that's what I say in my head when I see .suo.)
    It's user-specific and machine-specific, and therefore not something that should be committed to your revision control system.

  • How CSSCAN determines which indexes need to be rebuild ?

    Hi everybody,
    i'm currently migrating 3 Oracle databases that contain CP1252 characters unproperly stored in WE8ISO8859P1 instances.
    The key steps of the migration are :
    1. ALTERing CHARACTERSET to WE8MSWIN1252
    2. changing CHARACTER SEMANTIC LENGTH for CHAR and VARCHAR2 columns
    3. truncating data stored in VARCHAR2(4000) columns
    2. Full export
    3. Full import in a ALL32UTF8 instance
    To do all of this (and especially the step 3), i use the CSSCAN utility (very practical !!!).
    And i have a question about CSSCAN: how CSSCAN determines which indexes need to be rebuild. What is the logic ?
    Looking at the CSSCAN report, i have a lot of cells/columns that are affected by the characterset migration, and i have just a few index to rebuild.
    Why would i like to understand the logic ? Because i would like to rebuild ONLY indexes that REALLY need to be rebuilt and i am not sure that all the indexes specified by CSSCAN really need to be rebuilt.
    Thanks for any information about that.
    (and sorry for my english)
    NB: i have managed "function-based indexes" specifically: i drop them before the export, and i recreate them after the import. So my question mostly target the "regular indexes"

    1. All indexes whose key contains at least one character column with convertible or exceptional data, excluding indexes with names equal to some constraint name for the same owner.
    plus
    2. All functional indexes on tables that have columns needing conversion, excluding indexes with names equal to some constraint name for the same owner.
    The condition regarding constraints does not seem to be very fortunate but it comes from times when the appropriate flag in index metadata was not yet available.
    But note that in your migration scenario, you do not actually have to care much about indexes. Step 1 & 2 do not need any modifications to the user data and hence to index contents. Step 3, if done through UPDATE, will modify affected indexes automatically. Step 4 does not affect the database. Step 5 will recreate all existing indexes anyway.
    -- Sergiusz

  • How do I transfer files from a flash drive to iMac. I get a folder with "no name" which I can live with but I can't find any way to make the actual physical transfer of the files to the iMac.

    How do I transfer files from a flash drive to my new iMac?  I get a folder with "no name" that I can live with but I can't find a way to transfer the flass drive files to to iMac hard drive.

    What happens when you try to drag & drop the files?
    ~Lyssa

  • I have deleted my private folder and do not have enough space to reinstall my operating system. How can i transfer files from my hard drive to an USB drive to free up space when the operating system isn't working. or do i need to erase disk?

    i have deleted my private folder and do not have enough space to reinstall my operating system. How can i transfer files from my hard drive to an USB drive to free up space when the operating system isn't working. or do i need to erase disk through disk utilities without erasing data (but will it delete my programs such as photoshop, office, creative suite?

    Connect the computer to another Mac and put it in FireWire Target Disk mode, or use the Disk Utility to clone the drive or image specific folders with the USB drive as the target. After you've copied off everything you want, you'll likely need to erase the drive and reinstall the applications.
    (69695)

Maybe you are looking for