static void logfile_open(const char *filename) { Fd = open(filename, O_LARGFILE); if (0 > Fd) { perror("open"); exit(EXIT_FAILURE); } if (0 > stat(filename, &Stat)) { perror("stat"); exit(EXIT_FAILURE); } Map = mmap(NULL, (size_t)Stat.st_size, 0, PROT_READ, MAP_SHARED, Fd, 0); if (NULL == Map) { perror("mmap"); exit(EXIT_FAILURE); } ShmId = shmget((key_t)0, ShmBytes, IPC_CREAT); if (-1 == ShmId) { perror("shmget"); exit(EXIT_FAILURE); } ShmPtr = shmat(ShmId, ptr, 0); if (NULL == ShmPtr) { perror("shmat"); mem_close(); exit(EXIT_FAILURE); } }
void main_close() { debug_kill(); #ifdef WIN32 timeEndPeriod(1); #endif config_save(); cmos_save(models[curmodel]); midi_close(); mem_close(); uef_close(); csw_close(); tube_6502_close(); arm_close(); x86_close(); z80_close(); w65816_close(); n32016_close(); disc_close(0); disc_close(1); scsi_close(); ide_close(); vdfs_close(); ddnoise_close(); tapenoise_close(); al_close(); video_close(); log_close(); }
blMain() { mem_init(); test_declarator(); test_assignment(); test_selection_if(); test_selection_exp(); mem_close(); }