aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/sysdep.c161
1 files changed, 83 insertions, 78 deletions
diff --git a/src/sysdep.c b/src/sysdep.c
index 74c58559a16..a61747bd014 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -1388,8 +1388,10 @@ init_sys_modes ()
1388#endif 1388#endif
1389 1389
1390#if defined (HAVE_TERMIOS) || defined (HPUX9) 1390#if defined (HAVE_TERMIOS) || defined (HPUX9)
1391#ifdef TCOON
1391 if (!flow_control) tcflow (input_fd, TCOON); 1392 if (!flow_control) tcflow (input_fd, TCOON);
1392#endif 1393#endif
1394#endif
1393 1395
1394#ifdef AIXHFT 1396#ifdef AIXHFT
1395 hft_init (); 1397 hft_init ();
@@ -2640,84 +2642,6 @@ sys_sigsetmask (sigset_t new_mask)
2640 2642
2641#endif /* POSIX_SIGNALS */ 2643#endif /* POSIX_SIGNALS */
2642 2644
2643#ifndef BSTRING
2644
2645#ifndef bzero
2646
2647void
2648bzero (b, length)
2649 register char *b;
2650 register int length;
2651{
2652#ifdef VMS
2653 short zero = 0;
2654 long max_str = 65535;
2655
2656 while (length > max_str) {
2657 (void) LIB$MOVC5 (&zero, &zero, &zero, &max_str, b);
2658 length -= max_str;
2659 b += max_str;
2660 }
2661 max_str = length;
2662 (void) LIB$MOVC5 (&zero, &zero, &zero, &max_str, b);
2663#else
2664 while (length-- > 0)
2665 *b++ = 0;
2666#endif /* not VMS */
2667}
2668
2669#endif /* no bzero */
2670
2671#ifndef bcopy
2672/* Saying `void' requires a declaration, above, where bcopy is used
2673 and that declaration causes pain for systems where bcopy is a macro. */
2674bcopy (b1, b2, length)
2675 register char *b1;
2676 register char *b2;
2677 register int length;
2678{
2679#ifdef VMS
2680 long max_str = 65535;
2681
2682 while (length > max_str) {
2683 (void) LIB$MOVC3 (&max_str, b1, b2);
2684 length -= max_str;
2685 b1 += max_str;
2686 b2 += max_str;
2687 }
2688 max_str = length;
2689 (void) LIB$MOVC3 (&length, b1, b2);
2690#else
2691 while (length-- > 0)
2692 *b2++ = *b1++;
2693#endif /* not VMS */
2694}
2695#endif /* no bcopy */
2696
2697#ifndef bcmp
2698int
2699bcmp (b1, b2, length) /* This could be a macro! */
2700 register char *b1;
2701 register char *b2;
2702 register int length;
2703{
2704#ifdef VMS
2705 struct dsc$descriptor_s src1 = {length, DSC$K_DTYPE_T, DSC$K_CLASS_S, b1};
2706 struct dsc$descriptor_s src2 = {length, DSC$K_DTYPE_T, DSC$K_CLASS_S, b2};
2707
2708 return STR$COMPARE (&src1, &src2);
2709#else
2710 while (length-- > 0)
2711 if (*b1++ != *b2++)
2712 return 1;
2713
2714 return 0;
2715#endif /* not VMS */
2716}
2717#endif /* no bcmp */
2718
2719#endif /* not BSTRING */
2720
2721#ifndef HAVE_RANDOM 2645#ifndef HAVE_RANDOM
2722#ifdef random 2646#ifdef random
2723#define HAVE_RANDOM 2647#define HAVE_RANDOM
@@ -5038,3 +4962,84 @@ dlclose ()
5038} 4962}
5039 4963
5040#endif /* USE_DL_STUBS */ 4964#endif /* USE_DL_STUBS */
4965
4966#ifndef BSTRING
4967
4968#ifndef bzero
4969
4970void
4971bzero (b, length)
4972 register char *b;
4973 register int length;
4974{
4975#ifdef VMS
4976 short zero = 0;
4977 long max_str = 65535;
4978
4979 while (length > max_str) {
4980 (void) LIB$MOVC5 (&zero, &zero, &zero, &max_str, b);
4981 length -= max_str;
4982 b += max_str;
4983 }
4984 max_str = length;
4985 (void) LIB$MOVC5 (&zero, &zero, &zero, &max_str, b);
4986#else
4987 while (length-- > 0)
4988 *b++ = 0;
4989#endif /* not VMS */
4990}
4991
4992#endif /* no bzero */
4993#endif /* BSTRING */
4994
4995#if (defined (BSTRING) && !defined (bcopy)) || defined (NEED_BCOPY)
4996#undef bcopy
4997
4998/* Saying `void' requires a declaration, above, where bcopy is used
4999 and that declaration causes pain for systems where bcopy is a macro. */
5000bcopy (b1, b2, length)
5001 register char *b1;
5002 register char *b2;
5003 register int length;
5004{
5005#ifdef VMS
5006 long max_str = 65535;
5007
5008 while (length > max_str) {
5009 (void) LIB$MOVC3 (&max_str, b1, b2);
5010 length -= max_str;
5011 b1 += max_str;
5012 b2 += max_str;
5013 }
5014 max_str = length;
5015 (void) LIB$MOVC3 (&length, b1, b2);
5016#else
5017 while (length-- > 0)
5018 *b2++ = *b1++;
5019#endif /* not VMS */
5020}
5021#endif /* (defined (BSTRING) && !defined (bcopy)) || defined (NEED_BCOPY) */
5022
5023#ifdef BSTRING
5024#ifndef bcmp
5025int
5026bcmp (b1, b2, length) /* This could be a macro! */
5027 register char *b1;
5028 register char *b2;
5029 register int length;
5030{
5031#ifdef VMS
5032 struct dsc$descriptor_s src1 = {length, DSC$K_DTYPE_T, DSC$K_CLASS_S, b1};
5033 struct dsc$descriptor_s src2 = {length, DSC$K_DTYPE_T, DSC$K_CLASS_S, b2};
5034
5035 return STR$COMPARE (&src1, &src2);
5036#else
5037 while (length-- > 0)
5038 if (*b1++ != *b2++)
5039 return 1;
5040
5041 return 0;
5042#endif /* not VMS */
5043}
5044#endif /* no bcmp */
5045#endif /* not BSTRING */