From ae504c6e4f83f1ecf30355e1fe9b1499fe8064f8 Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Sat, 2 Oct 2021 14:34:35 -0500 Subject: [PATCH] Add support for EILSEQ errno value. EILSEQ is required by C95 and later. --- equates.asm | 1 + stdio.asm | 4 +++- string.asm | 2 +- vars.asm | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/equates.asm b/equates.asm index 4d7fd05..b09f088 100644 --- a/equates.asm +++ b/equates.asm @@ -19,6 +19,7 @@ EMFILE gequ 8 too many files are open EACCES gequ 9 access bits prevent the operation EEXIST gequ 10 the file exists ENOSPC gequ 11 the file is too large +EILSEQ gequ 12 encoding error ; ; masks for the __ctype array ; diff --git a/stdio.asm b/stdio.asm index d17de58..af88cd5 100644 --- a/stdio.asm +++ b/stdio.asm @@ -2179,7 +2179,7 @@ rts creturn 4:s **************************************************************** * perror start -maxErr equ ENOSPC max error in sys_errlist +maxErr equ EILSEQ max error in sys_errlist s equ 4 string address @@ -3010,6 +3010,7 @@ sys_errlist start dc a4'EACCESS' dc a4'EEXISTS' dc a4'ENOSPC' + dc a4'EILSEQ' ! Note: if more errors are added, change maxErr in perror() and strerror(). @@ -3025,6 +3026,7 @@ EMFILE cstr 'too many files are open' EACCESS cstr 'access bits prevent the operation' EEXISTS cstr 'the file exists' ENOSPC cstr 'the file is too large' +EILSEQ cstr 'encoding error' end **************************************************************** diff --git a/string.asm b/string.asm index a39a467..d93be8e 100644 --- a/string.asm +++ b/string.asm @@ -912,7 +912,7 @@ lb2 sty set set the disp past the current disp **************************************************************** * strerror start -maxErr equ ENOSPC max error in sys_errlist +maxErr equ EILSEQ max error in sys_errlist phb get the error number plx diff --git a/vars.asm b/vars.asm index 523c4e0..80a1de4 100644 --- a/vars.asm +++ b/vars.asm @@ -31,7 +31,7 @@ _ownerid entry user ID (C) ~USER_ID entry user ID (Pascal, libraries) ds 2 sys_nerr entry # of error messages - dc i'12' + dc i'13' _toolErr entry last error in a tool call (C) ~TOOLERROR entry last error in a tool call (Pascal) ds 2