poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/3] pvm,ios: add IOS_E_PERM and make the PVM to handle it


From: Jose E. Marchesi
Subject: [PATCH 2/3] pvm,ios: add IOS_E_PERM and make the PVM to handle it
Date: Sat, 27 Mar 2021 12:37:10 +0100

2021-03-27  Jose E. Marchesi  <jemarch@gnu.org>

        * libpoke/ios.h (IOS_EPERM): Define.
        * libpoke/pvm.jitter (PVM_PEEK): Raise PVM_E_PERM if the IO
        subsystem reports IOS_EPERM.
        (PVM_POKE): Likewise.
        (peeks): Likewise.
        (pokes): Likewise.
---
 ChangeLog          | 9 +++++++++
 libpoke/ios.h      | 3 +++
 libpoke/pvm.jitter | 8 ++++++++
 3 files changed, 20 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 534f04d1..d46d92fe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2021-03-27  Jose E. Marchesi  <jemarch@gnu.org>
+
+       * libpoke/ios.h (IOS_EPERM): Define.
+       * libpoke/pvm.jitter (PVM_PEEK): Raise PVM_E_PERM if the IO
+       subsystem reports IOS_EPERM.
+       (PVM_POKE): Likewise.
+       (peeks): Likewise.
+       (pokes): Likewise.
+
 2021-03-27  Jose E. Marchesi  <jemarch@gnu.org>
 
        * libpoke/pvm.h (PVM_E_PERM): Define.
diff --git a/libpoke/ios.h b/libpoke/ios.h
index 8ff07dde..4214e4c3 100644
--- a/libpoke/ios.h
+++ b/libpoke/ios.h
@@ -100,6 +100,9 @@ typedef int64_t ios_off;
 
 #define IOS_EOPEN  -7  /* IO space is already open.  */
 
+#define IOS_EPERM  -8  /* Insufficient permissions to perform the
+                          requested operation.  */
+
 #define IOD_ERROR_TO_IOS_ERROR(error_no) (error_no)
 
 /* **************** IOS flags ******************************
diff --git a/libpoke/pvm.jitter b/libpoke/pvm.jitter
index 16224ad2..37abc809 100644
--- a/libpoke/pvm.jitter
+++ b/libpoke/pvm.jitter
@@ -510,6 +510,8 @@ late-header-c
             PVM_RAISE_DFL (PVM_E_EOF);                                       \
          else if (ret == IOS_ENOMEM)                                         \
             PVM_RAISE (PVM_E_IO, "out of memory", PVM_E_IO_ESTATUS);         \
+         else if (ret == IOS_EPERM)                                          \
+            PVM_RAISE_DFL (PVM_E_PERM);                                      \
          else                                                                \
             PVM_RAISE_DFL (PVM_E_IO);                                        \
          JITTER_TOP_STACK () = PVM_NULL;                                     \
@@ -549,6 +551,8 @@ late-header-c
        {                                                                     \
          if (ret == IOS_EIOFF)                                               \
             PVM_RAISE_DFL (PVM_E_EOF);                                       \
+         else if (ret == IOS_EPERM)                                          \
+            PVM_RAISE_DFL (PVM_E_PERM);                                      \
          else                                                                \
             PVM_RAISE_DFL (PVM_E_IO);                                        \
        }                                                                     \
@@ -5514,6 +5518,8 @@ instruction peeks ()
          PVM_RAISE_DFL (PVM_E_EOF);
       else if (ret == IOS_ENOMEM)
          PVM_RAISE (PVM_E_IO, "out of memory", PVM_E_IO_ESTATUS);
+      else if (ret == IOS_EPERM)
+         PVM_RAISE_DFL (PVM_E_PERM);
       else
          PVM_RAISE_DFL (PVM_E_IO);
       JITTER_TOP_STACK () = PVM_NULL;
@@ -5551,6 +5557,8 @@ instruction pokes ()
     {
       if (ret == IOS_EIOFF)
          PVM_RAISE_DFL (PVM_E_EOF);
+      else if (ret == IOS_EPERM)
+         PVM_RAISE_DFL (PVM_E_PERM);
       else
          PVM_RAISE_DFL (PVM_E_IO);
     }
-- 
2.25.0.2.g232378479e




reply via email to

[Prev in Thread] Current Thread [Next in Thread]