Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // From IBM and their ideas...
- #include <stdio.h>
- #include <signal.h>
- #include <errno.h>
- #include <stdlib.h>
- #include <string.h>
- #ifdef __cplusplus
- extern "C" {
- #endif
- void iohdlr(int);
- #ifdef __cplusplus
- }
- #endif
- int main(void) {
- FILE *fp;
- char buffer[80];
- int i = 0;
- signal(SIGIOERR, iohdlr);
- /* open an MVS binary file */
- fp = fopen("testfull.file","wb, recfm=F, lrecl=80");
- if (fp == NULL) exit(99);
- memset(buffer, 'A', 80);
- /* write to MVS file until it runs out of extents */
- while (fwrite(buffer, 1, 80, fp) == 80)
- ++i;
- printf("number of successful fwrites of 80 bytes = %d\n", i);
- return 0;
- }
- void iohdlr (int signum) {
- __amrc_type save_amrc;
- __amrc2_type save_amrc2;
- char filename[FILENAME_MAX];
- fldata_t info;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement