aboutsummaryrefslogtreecommitdiff
path: root/lib/sg_pt_osf1.c
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2008-11-30 16:21:28 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2008-11-30 16:21:28 +0000
commitada3d4282e65ecd9b7ab901688402f6291235656 (patch)
treed879b0f93834bbf23d4d8cc36384bd10cb557580 /lib/sg_pt_osf1.c
parent04f140bf5efb0e78163b527b3d38f213702d13f1 (diff)
downloadsg3_utils-ada3d4282e65ecd9b7ab901688402f6291235656.tar.gz
add scsi_pt_open_flags() and related sg_cmd_open_flags() [for sgdd]
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@201 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'lib/sg_pt_osf1.c')
-rw-r--r--lib/sg_pt_osf1.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/sg_pt_osf1.c b/lib/sg_pt_osf1.c
index 7814a6a0..4718da06 100644
--- a/lib/sg_pt_osf1.c
+++ b/lib/sg_pt_osf1.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005-2007 Douglas Gilbert.
+ * Copyright (c) 2005-2008 Douglas Gilbert.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -91,6 +91,17 @@ int scsi_pt_open_device(const char * device_name,
int read_only,
int verbose)
{
+ int oflags = 0 /* O_NONBLOCK*/ ;
+
+ oflags |= (read_only ? O_RDONLY : O_RDWR);
+ return scsi_pt_open_flags(device_name, oflags, verbose);
+}
+
+/* Similar to scsi_pt_open_device() but takes Unix style open flags OR-ed */
+/* together. The 'flags' argument is ignored in OSF-1. */
+/* Returns >= 0 if successful, otherwise returns negated errno. */
+int scsi_pt_open_flags(const char * device_name, int flags, int verbose)
+{
struct osf1_dev_channel *fdchan;
int fd, k;