bugGNU Parallel - Bugs: bug #53047, FreeBSD block device emulation

 
 

bug #53047: FreeBSD block device emulation

Submitter:  Ole Tange <tange>
Submitted:  Fri 02 Feb 2018 07:27:54 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Wont Fix
Privacy:  Public Assigned to:  tange
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 25 Mar 2018 12:04:13 PM UTC, comment #1: 

Seekable, but not readable. This fails:

$blockdev="/dev/ad0";
if(open(my $fh, "<", $blockdev)) {
        # Cannot seek to end (FreeBSD?)                                                      
        seek($fh,10,0);
        read($fh,$buf,10) or die;
        my $size = tell($fh);
        close $fh;
        die $size;
}

I do not see a way to fix this.

Ole Tange <tange>
Group administrator
Fri 02 Feb 2018 07:27:54 AM UTC, original submission:  

FreeBSD's char devices are seekable:


 if(open(my $fh, "<", $blockdev)) {
        if(seek($fh,0,2) and tell($fh)) {
            # Can seek to end                                                                
            my $size = tell($fh);
            close $fh;
            return $size;
        } else {
            # Cannot seek to end (FreeBSD?)                                                  
            seek($fh,10,0);
            seek($fh,190,0);
            seek($fh,10,0);
            my $size = tell($fh);
            close $fh;
            die $size;
        }
    } else {
        ::error("cannot open $blockdev");
 
Using exponential seeks the size should be determinable.

Ole Tange <tange>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by tange (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-03-25 tange Assigned toNone tange
        Open/ClosedOpen Closed
    2018-03-25 tange StatusNone Wont Fix

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code