summaryrefslogtreecommitdiff
path: root/src/unexhp9k800.c
Commit message (Collapse)AuthorAge
* Use fewer locks when accessing stdioPaul Eggert2019-07-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/alloc.c, src/bidi.c, src/emacs-module.c, src/pdumper.c: * src/regex-emacs.c, src/unexhp9k800.c, src/unexmacosx.c: * src/widget.c, src/xdisp.c, src/xselect.c, src/xterm.c: Include sysstdio.h instead of stdio.h, to avoid locking stdio streams in many cases. * src/alloc.c (test_setjmp): * src/bidi.c (bidi_dump_cached_states): * src/cm.c (calccost): * src/dispnew.c (init_display_interactive): * src/emacs.c (main): * src/image.c (convert_mono_to_color_image): * src/minibuf.c (read_minibuf_noninteractive): * src/nsfont.m (ns_descriptor_to_entity) (ns_dump_glyphstring): * src/nsterm.h (NSTRACE_MSG_NO_DASHES): * src/nsterm.m (ns_mouse_position) (sendEvent:, keyDown:, performDragOperation:): * src/pdumper.c (dump_fingerprint, print_paths_to_root_1): * src/print.c (debug_print): * src/regex-emacs.c (debug_putchar, print_fastmap) (print_partial_compiled_pattern, print_compiled_pattern) (print_double_string, regex_compile): * src/term.c (vfatal): * src/unexhp9k800.c (read_header): * src/unexmacosx.c (unexec_error): * src/widget.c (EmacsFrameInitialize): * src/xdisp.c (message_to_stderr, vmessage, dump_glyph_row) (Fdump_glyph_matrix, Fdump_frame_glyph_matrix, dump_glyph_string): * src/xfaces.c (Fdump_colors, Fdump_face): * src/xselect.c (x_clipboard_manager_error_2): * src/xterm.c (x_initialize): * src/xwidget.c (WEBKIT_FN_INIT): Prefer unlocked calls like fputs to locked calls like fprintf. * src/charset.c (read_hex): * src/cm.c (cmputc, cmcheckmagic): * src/dispnew.c (update_frame, update_frame_with_menu) (update_frame_1, Fsend_string_to_terminal, Fding) (bitch_at_user): * src/emacs.c (main, Fdump_emacs): * src/emacs-module.c (module_abort): * src/fileio.c (Fdo_auto_save): * src/image.c (slurp_file) (png_read_from_file, png_load_body, our_stdio_fill_input_buffer): * src/keyboard.c (record_char, kbd_buffer_get_event) (handle_interrupt): * src/lread.c (readbyte_from_stdio, read1): * src/minibuf.c (read_minibuf_noninteractive): * src/print.c (printchar_to_stream, strout) (Fredirect_debugging_output): * src/sysdep.c (reset_sys_modes, close_output_streams) (procfs_ttyname, procfs_get_total_memory): * src/term.c (tty_ring_bell, tty_send_additional_strings) (tty_set_terminal_modes, tty_reset_terminal_modes) (tty_update_end, tty_clear_end_of_line, tty_write_glyphs) (tty_write_glyphs_with_face, tty_insert_glyphs) (tty_menu_activate): * src/xfaces.c (Fx_load_color_file): Simplify by using ordinary calls like putc to explicitly-unlocked calls like putc_unlocked, since the ordinary calls are now unlocked anyway. * src/emacs.c (main, Fdump_emacs): * src/pdumper.c (Fdump_emacs_portable): Coalesce adjacent printfs. * src/nsterm.h: Include sysstdio.h as this file’s macros rely on it. * src/regex-emacs.c (print_compiled_pattern): Omit redundant fflush. * src/sysstdio.h: Include unlocked-io.h. (clearerr_unlocked, feof_unlocked, ferror_unlocked) (fflush_unlocked, fgets_unlocked, fputc_unlocked) (fputs_unlocked, fread_unlocked, fwrite_unlocked) (getc_unlocked, getchar_unlocked, putc_unlocked) (putchar_unlocked): Remove these macros; now done by unlocked-io.h. * src/xwidget.c: Include sysstdio.h.
* Consistently use min and max macros from lisp.h.Dmitry Antipov2014-10-03
| | | | | | | | | | * coding.c (min, max): * font.c (MAX): * unexhp9k800.c (min): * unexw32.c (min, max): Use definitions from lisp.h. * regex.c (MAX, MIN) [!emacs]: Define own max and min as such. Adjust users. * gmalloc.c (min): Tiny style change.
* Fix subspace record bug on HP-UX 10.20.Paul Eggert2014-02-13
| | | | | | | | | | | * unexhp9k800.c (unexec_error): New function, to simplify the code. (check_lseek): New function, to report lseek errors. (save_data_space, update_file_ptrs, read_header, write_header) (copy_file, copy_rest, unexec): Use these news functions. (update_file_ptrs): Don't assume wraparound behavior when converting a large size_t value to off_t. Fixes: debbugs:16717
* Fix races with threads and file descriptors.Paul Eggert2013-07-11
| | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac (PTY_TTY_NAME_SPRINTF): Use emacs_close, not close. * src/callproc.c (Fcall_process_region): * src/dired.c (open_directory): * src/emacs.c (main, Fdaemon_initialized): * src/image.c (x_find_image_file): * src/inotify.c (Finotify_rm_watch): * src/lread.c (Flocate_file_internal): * src/process.c (Fnetwork_interface_list, Fnetwork_interface_info): * src/term.c (term_mouse_moveto, init_tty): * src/termcap.c (tgetent): * src/unexaix.c, src/unexcoff.c (report_error, report_error_1, adjust_lnnoptrs) * src/unexaix.c, src/unexcoff.c, src/unexcw.c, src/unexelf.c (unexec): * src/unexhp9k800.c, src/unexmacosx.c (unexec): * src/callproc.c (Fcall_process_region): Use emacs_close, not close. * src/sysdep.c (POSIX_CLOSE_RESTART, posix_close) [!POSIX_CLOSE_RESTART]: New macro and function, which emulates the POSIX_CLOSE_RESTART macro and posix_close function on current platforms (which all lack them). (emacs_close): Use it. This should fix the races on GNU/Linux and on AIX and on future platforms that support POSIX_CLOSE_RESTART, and it should avoid closing random victim file descriptors on other platforms.
* Use emacs_open more consistently when opening files.Paul Eggert2013-07-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This handles EINTR more consistently now, and makes it easier to introduce other uniform changes to file descriptor handling. * src/systdio.h: New file. * src/buffer.c (mmap_init): * cygw32.c (chdir_to_default_directory): * dispnew.c (Fopen_termscript): * emacs.c (Fdaemon_initialized): * fileio.c (Fdo_auto_save): * image.c (slurp_file, png_load_body, jpeg_load_body): * keyboard.c (Fopen_dribble_file): * lread.c (Fload): * print.c (Fredirect_debugging_output): * sysdep.c (get_up_time, procfs_ttyname, procfs_get_total_memory): * termcap.c (tgetent): * unexaix.c, unexcoff.c (unexec, adjust_lnnoptrs): * unexcw.c, unexelf.c, unexhp9k800.c, unexmacosx.c (unexec): * w32term.c (w32_initialize) [CYGWIN]: * xfaces.c (Fx_load_color_file): Use emacs_open instead of plain open, and emacs_fopen instead of plain fopen. * dispnew.c, fileio.c, image.c, keyboard.c, lread.c, print.c, sysdep.c: * xfaces.c: Include sysstdio.h rather than stdio.h, for emacs_fopen. * callproc.c (default_output_mode): New constant. (Fcall_process): Use it to call emacs_open instead of plain creat. * dispnew.c (Fopen_termscript): Fix minor race in opening termscript. * sysdep.c (emacs_open): Add commentary and don't call file name "path". (emacs_fopen): New function. * unexaix.c, unexcoff.c, unexelf.c, unexhp9k800.c, unexmacosx.c: Include <lisp.h>, for emacs_open. * unexelf.c (fatal): Remove decl; not needed with <lisp.h> included.
* ProtoizeAndreas Schwab2011-07-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge) (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Protoize. * src/data.c (fmod): Likewise. * src/dispnew.c (swap_glyphs_in_rows): Likewise. * src/emacs.c (memory_warning_signal): Likewise. * src/floatfns.c (float_error): Likewise. * src/font.c (check_gstring, check_otf_features, otf_tag_symbol) (otf_open, font_otf_capability, generate_otf_features) (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor): Likewise. * src/image.c (pbm_read_file): Likewise. * src/indent.c (string_display_width): Likewise. * src/intervals.c (check_for_interval, search_for_interval) (inc_interval_count, count_intervals, root_interval) (adjust_intervals_for_insertion, make_new_interval): Likewise. * src/lread.c (defalias): Likewise. * src/regex.c (set_image_of_range_1, set_image_of_range) (regex_grow_registers): Likewise. * src/sysdep.c (strerror): Likewise. * src/termcap.c (valid_filename_p, tprint, main): Likewise. * src/tparam.c (main): Likewise. * src/unexhp9k800.c (run_time_remap, save_data_space) (update_file_ptrs, read_header, write_header, calculate_checksum) (copy_file, copy_rest, display_header): Likewise. * src/widget.c (mark_shell_size_user_specified, create_frame_gcs): Likewise. * src/xdisp.c (check_it): Likewise. * src/xfaces.c (register_color, unregister_color, unregister_colors): Likewise. * src/xfns.c (print_fontset_result): Likewise. * src/xrdb.c (member, fatal, main): Likewise.
* Change unexec implementations to match prototype.Paul Eggert2011-03-17
|
* New file unexec.h, the (simple) interface for unexec.Paul Eggert2011-03-16
| | | | | | | | | * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o): (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o): Depend on unexec.h. * emacs.c [!defined CANNOT_DUMP]: Include unexec.h. * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c: * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
* Nuke arch-tags.Glenn Morris2011-01-15
|
* Remove #ifdef emacs / #ifndef emacs code, unused.Dan Nicolaescu2010-10-10
| | | | | | | | * src/vm-limit.c: * src/unexhp9k800.c: * src/unexelf.c: * src/unexaix.c: * src/termcap.c: Remove #ifdef emacs / #ifndef emacs code, unused.
* Remove unused arguments for unexec.Dan Nicolaescu2010-10-03
| | | | | | | | | | | | | | | | | | | | | | | The third one is never used, and the last two are always passed as zero. * src/emacs.c (unexec): Add declaration. (Fdump_emacs): Only pass the first two arguments to unexec. Simplify #ifdef. * src/unexw32.c (unexec): * src/unexsol.c (unexec): * src/unexhp9k800.c (unexec): * src/unexcw.c (unexec): Remove the last 3 arguments, unused. * src/unexelf.c (unexec): Remove the last 3 arguments, unused. (find_section): Use const. * src/unexmacosx.c (unexec): Remove the last 3 arguments, unused. (unexec_error): Declare it NO_RETURN. * src/unexcoff.c (make_hdr): Assume bss_start is always zero, remove it as an argument, remove data_start and entry_address arguments, unused. (unexec): Remove bss_start, data_start and entry_address arguments. * src/unexaix.c (make_hdr): Assume bss_start is always zero, remove it as an argument, remove data_start and entry_address arguments, unused. (unexec): Remove bss_start, data_start and entry_address arguments.
* * unexnext.c:Dan Nicolaescu2008-06-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * m/ews4800.h: * m/hp9000s300.h: * m/ibm370aix.h: * m/mips-siemens.h: * m/ncr386.h: * m/next.h: * m/pmax.h: * m/powerpcle.h: * m/tandem-s2.h: * s/386bsd.h: * s/bsd386.h: * s/bsd4-1.h: * s/bsd4-2.h: * s/bsdos2-1.h: * s/bsdos2.h: * s/bsdos3.h: * s/bsdos4.h: * s/nextstep.h: * s/ultrix4-3.h: * s/usg5-0.h: * s/usg5-2-2.h: * s/usg5-2.h: * s/usg5-4-3.h: * s/ux4800.h: * s/uxpds.h: * s/uxpv.h: Remove support for obsolete systems. * s/hpux.h, s/hpux10.h, s/hpux8.h, s/hpux9.h, s/hpux9shr.h: Remove, insert contents in s/hpux-10.20.h * s/aix3-1.h, s/aix3-2-5.h, s/aix3-2.h, s/aix4-1.h, s/aix4.h: Remove, insert contents in s/aix-4.2.h * s/usg5-3.h: Remove, insert contents in s/usg5-4.h. * s/bsd4-3.h: Rename to .. * s/bsd-common.h: ... this. * src/data.c: * src/doc.c: * src/ecrt0.c: * src/emacs.c: * src/fileio.c: * src/floatfns.c: * src/keyboard.c: * src/mem-limits.h: * src/print.c: * src/process.c: * src/sysdep.c: * src/syssignal.h: * src/systty.h: * src/syswait.h: * src/term.c: * src/unexec.c: * src/unexelf.c: * src/unexhp9k800.c: * src/m/hp800.h: * src/m/ibmrs6000.h: * src/m/mips.h: * src/m/vax.h: * src/s/darwin.h: * src/s/freebsd.h: * src/s/gnu.h: * src/s/ms-w32.h: * src/s/msdos.h: * src/s/netbsd.h: * src/s/template.h: Remove references to obsolete variables. * Makefile.in: Add dependencies for all unexec files. (admindir): Remove unused variable. (UNEXEC_SRC): Remove references. * config.nt: Remove reference to UNEXEC_SRC. * lwlib.c: Remove references to obsolete variables. * fakemail.c: Remove references to obsolete variables. * os.texi: Remove references to obsolete systems. * configure.in: * configure: Remove references to obsolete systems.
* (read_header): Replace `legal' with `valid'.Juanma Barranquero2008-02-05
|
* Restore file with clarified legal status.Glenn Morris2007-03-23
|
* * unexhp9k800.c: Remove due to lack of legal papers.Chong Yidong2007-01-27
| | | | * m/sr2k.h, m/hp800.h: Remove due to dependence on above.
* Add arch taglinesMiles Bader2003-09-01
|
* Trailing whitespace deleted.Juanma Barranquero2003-02-04
|
* Add support for large files, 64-bit Solaris, system locale codings.Paul Eggert1999-10-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Makefile.in (emacs): Set the LC_ALL environment variable to "C" when dumping, so that the dumped Emacs doesn't have stray locale info. (dired.o): Depend on systime.h. (editfns.o): Depend on coding.h. * alloc.c, buffer.c, callproc.c, ccl.c, charset.c, coding.c, data.c, dispnew.c, editfns.c, emacs.c, filelock.c, floatfns.c, hftctl.c, keyboard.c, process.c, sysdep.c, unexelf.c, unexhp9k800.c, unexsunos4.c, vmsfns.c, vmsgmalloc.c, w32faces.c, w32menu.c, w32term.c, w32xfns.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Include <config.h> before any system include files. * alloc.c, buffer.c, ccl.c, data.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, frame.c, insdel.c, keymap.c, lread.c, m/alpha.h, print.c, search.c, sysdep.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Do not include <stdlib.h>, as <config.h> does this now. * callproc.c (Fcall_process): Synchronize messages locale before invoking strerror. Decode resulting string with locale-coding-system. * coding.c (Vlocale_coding_system): New var. (syms_of_coding): Adjust to above change. (emacs_strerror): New function. * coding.h (emacs_strerror, Vlocale_coding_system): New decls. * config.in (HAVE_STDIO_EXT_H, HAVE_TM_GMTOFF, HAVE___FPENDING, HAVE_FTELLO, HAVE_GETLOADAVG, HAVE_MBLEN, HAVE_MBRLEN, HAVE_STRSIGNAL): New macros. (BITS_PER_LONG): Default to 64 if _LP64 is defined. <stdlib.h>: Include if HAVE_STDLIB_H is defined and NOT_C_CODE isn't. * dired.c: Include "systime.h". (Ffile_attributes): Do not cast s.st_size to int; this loses information if int is 32 bits but st_size and EMACS_INT are larger. Treat large device numbers like large inode numbers. * dispnew.c (PENDING_OUTPUT_COUNT): Use __fpending if available. * editfns.c: Include coding.h. (emacs_strftime): Remove decl. (emacs_strftimeu): New decl. (emacs_memftimeu): Renamed from emacs_memftime; new arg UT. Use emacs_strftimeu instead of emacs_strftime. (Fformat_time_string): Convert format string using Vlocale_coding_system, and convert result back. Synchronize time locale before invoking lower level function. Invoke emacs_memftimeu, passing ut, instead of emacs_memftime. * emacs.c: Include <locale.h> if HAVE_SETLOCALE is defined. (Vmessages_locale, Vprevious_messages_locale, Vtime_locale, Vprevious_time_locale): New variables. (main): Invoke setlocale early, so that initial error messages are localized properly. But skip locale-setting if LC_ALL is "C". Fix up locale when it's safe to do so. (fixup_locale): Moved here from xterm.c. (synchronize_locale, synchronize_time_locale, synchronize_messages_locale): New functions. (syms_of_emacs): Accommodate above changes. * fileio.c (report_file_error): Convert strerror output according to Vlocale_coding_system. (Finsert_file_contents): Check for arithmetic overflow in computations that depend on file size. Report IO errors with emacs_strerror, not strerror. * fns.c (Fgethash): Declare dflt parameter. * gmalloc.c: Do not define const to nothing if HAVE_CONFIG_H is defined; that's config.h's job. * lisp.h (EMACS_INT, BITS_PER_EMACS_INT, EMACS_UINT): If _LP64, default these values to long, BITS_PER_LONG, and unsigned long. (VALBITS, MARKBIT, XINT): Do not assume 32-bit EMACS_INT. (PNTR_COMPARISON_TYPE): Default to EMACS_UINT, not to unsigned int. (code_convert_string_norecord, fixup_locale, synchronize_messages_locale, synchronize_time_locale, emacs_open, emacs_close, emacs_read, emacs_write): New decls. All Emacs callers of open, close, read, write changed to use emacs_open, emacs_close, emacs_read, emacs_write. * lread.c (file_offset, file_tell): New macros. All uses of ftell changed to file_tell. (saved_doc_string_position, prev_saved_doc_string_position): Now of type file_offset. (init_lread): Do not fix locale here; fixup_locale now does this. * m/amdahl.h, s/usg5-4.h: (NSIG): Remove. (NSIG_MINIMUM): New macro. * m/cydra5.h, m/dpx2.h, m/mips.h, m/pfa50.h, m/sps7.h, m/stride.h, m/ustation.h, s/gnu-linux.h, s/hpux.h, s/iris3-5.h, s/iris3-6.h, s/umips.h, s/usg5-4.h: (SIGIO): Do not undef. (BROKEN_SIGIO): New macro. * m/ustation.h: (SIGTSTP): Do not undef. (BROKEN_SIGTSTP): New macro. * s/gnu-linux.h: (SIGPOLL, SIGURG): Do not undef. (BROKEN_SIGPOLL, BROKEN_SIGURG): New macros. * s/ptx4.h: (SIGINFO): Do not undef. (BROKEN_SIGINFO): New macros. * m/delta.h, s/ptx.h, s/template.h: Doc fix. * mktime.c, strftime.c: Update to glibc 2.1.2 version, with some Emacs-related changes merged. * print.c (float_to_string): Prepend "-" to representation of a NaN if the NaN is negative. * process.c (sys_siglist): Omit if HAVE_STRSIGNAL. (wait_reading_process_input): Use emacs_strerror, not strerror. * process.c (status_message, sigchld_handler): Synchronize locale, then use strsignal istead of sys_siglist. * w32proc.c (sys_wait): Likewise. * s/aix3-1.h, s/bsd4-1.h, s/dgux.h, s/gnu-linux.h, s/hiuxmpp.h, s/hpux.h, s/iris3-5.h, s/iris3-6.h, s/irix3-3.h, s/osf1.h, s/rtu.h, s/sunos4-1.h, s/unipl5-0.h, s/unipl5-2.h, s/usg5-0.h, s/usg5-2-2.h, s/usg5-2.h, s/usg5-3.h, s/xenix.h: (open, close, read, write, INTERRUPTIBLE_OPEN, INTERRUPTIBLE_CLOSE, INTERRUPTIBLE_IO): Remove. * s/sol2-5.h (_LARGEFILE_SOURCE, _FILE_OFFSET_BITS): New macros. * sysdep.c (sys_read, sys_write, read, write, sys_close, close, sys_open, open): Remove. (emacs_open, emacs_close, emacs_read, emacs_write): Always define; the old INTERRUPTIBLE_OPEN, INTERRUPTIBLE_CLOSE, and INTERRUPTIBLE_IO macros are no longer used. (emacs_open): Renamed from sys_open. Merge BSD4_1 version. (emacs_close): Renamed from sys_close. (emacs_read): Renamed from sys_read. (emacs_write): Renamed from sys_write. (sys_siglist): Do not declare if HAVE_STRSIGNAL. (dup2): Do not print error on failure; the real dup2 doesn't. (strsignal): New function, defined if !HAVE_STRSIGNAL. * syssignal.h (SIGINFO): Undef if defined and if BROKEN_SIGINFO is defined. (SIGIO, SIGPOLL, SIGTSTP, SIGURG): Likewise. (NSIG): If less than NSIG_MINIMUM, define to NSIG_MINIMUM. (strsignal): Declare if !HAVE_STRSIGNAL. * unexelf.c (ElfBitsW, ELFSIZE, ElfExpandBitsW): New macros. (ElfW): Define in terms of ElfExpandBitsW. * w32proc.c (sys_siglist): Remove decl. * xdisp.c (decode_mode_spec): 3rd arg is int, not char, to comply with ANSI C. (display_string): Declare face_string_pos arg. * xfns.c (Fx_show_tip): Declare timeout param. * xterm.c: No need to include locale.h. (x_alloc_lighter_color, x_setup_relief_color): Pass arg as double, not float, for compatibility with ANSI C. (fixup_locale): Move to emacs.c. (x_term_init): Do not setlocale or fixup locale; the main program does this now.
* (unexec): Cast result of sbrk.Richard M. Stallman1996-06-28
| | | | (run_time_remap): Cat arg to brk.
* (roundup): Undef before defining.Richard M. Stallman1994-05-28
|
* Include config.h.Richard M. Stallman1994-05-22
| | | | | | | [HPUX_USE_SHLIBS]: Include dl.h. (brk_on_dump): New variable. (unexec): Set brk_on_dump. (copy_file): Change buffer size to 8192.
* Whitespace fixes.Richard M. Stallman1994-05-22
|
* (unexec): Don't call exit, just return.Richard M. Stallman1993-01-07
|
* entered into RCSJim Blandy1992-01-13
|
* Initial revisionJim Blandy1990-11-12