2012-03-08 Luis Machado <lgustavo@codesourcery.com>
[deliverable/binutils-gdb.git] / bfd / vms-misc.c
CommitLineData
0c376465 1/* vms-misc.c -- BFD back-end for VMS/VAX (openVMS/VAX) and
252b5132 2 EVAX (openVMS/Alpha) files.
3db64b00 3 Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
9fcd9da6 4 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
0c376465
TG
5
6 Miscellaneous functions.
252b5132
RH
7
8 Written by Klaus K"ampf (kkaempf@rmi.de)
9
7920ce38
NC
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
cd123cb7 12 the Free Software Foundation; either version 3 of the License, or
7920ce38 13 (at your option) any later version.
252b5132 14
7920ce38
NC
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
252b5132 19
7920ce38
NC
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
cd123cb7
NC
22 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
23 MA 02110-1301, USA. */
252b5132 24
252b5132
RH
25#if __STDC__
26#include <stdarg.h>
27#endif
28
252b5132 29#include "sysdep.h"
3db64b00 30#include "bfd.h"
252b5132
RH
31#include "bfdlink.h"
32#include "libbfd.h"
4b544b64 33#include "safe-ctype.h"
252b5132 34
95e34ef7 35#ifdef VMS
953b49ed 36#define __NEW_STARLET
95e34ef7
TG
37#include <rms.h>
38#include <unixlib.h>
953b49ed 39#include <gen64def.h>
95e34ef7
TG
40#include <starlet.h>
41#define RME$C_SETRFM 0x00000001
42#include <unistd.h>
43#endif
44#include <time.h>
0c376465 45
95e34ef7
TG
46#include "vms.h"
47#include "vms/emh.h"
0c376465 48
252b5132 49#if VMS_DEBUG
7920ce38 50/* Debug functions. */
252b5132 51
0c376465
TG
52/* Debug function for all vms extensions evaluates environment
53 variable VMS_DEBUG for a numerical value on the first call all
54 error levels below this value are printed:
558e161f 55
0c376465 56 Levels:
252b5132
RH
57 1 toplevel bfd calls (functions from the bfd vector)
58 2 functions called by bfd calls
59 ...
60 9 almost everything
61
0c376465 62 Level is also indentation level. Indentation is performed
7920ce38 63 if level > 0. */
252b5132 64
252b5132
RH
65void
66_bfd_vms_debug (int level, char *format, ...)
67{
68 static int min_level = -1;
69 static FILE *output = NULL;
70 char *eptr;
71 va_list args;
7920ce38 72 int abslvl = (level > 0) ? level : - level;
252b5132
RH
73
74 if (min_level == -1)
75 {
7920ce38 76 if ((eptr = getenv ("VMS_DEBUG")) != NULL)
252b5132 77 {
7920ce38 78 min_level = atoi (eptr);
252b5132
RH
79 output = stderr;
80 }
81 else
82 min_level = 0;
83 }
84 if (output == NULL)
85 return;
86 if (abslvl > min_level)
87 return;
88
95e34ef7 89 while (--level > 0)
558e161f 90 fprintf (output, " ");
7920ce38 91 va_start (args, format);
558e161f 92 vfprintf (output, format, args);
7920ce38
NC
93 fflush (output);
94 va_end (args);
252b5132
RH
95}
96
7920ce38
NC
97/* A debug function
98 hex dump 'size' bytes starting at 'ptr'. */
252b5132
RH
99
100void
95e34ef7 101_bfd_hexdump (int level, unsigned char *ptr, int size, int offset)
252b5132
RH
102{
103 unsigned char *lptr = ptr;
104 int count = 0;
105 long start = offset;
106
107 while (size-- > 0)
108 {
95e34ef7 109 if ((count % 16) == 0)
252b5132
RH
110 vms_debug (level, "%08lx:", start);
111 vms_debug (-level, " %02x", *ptr++);
112 count++;
113 start++;
114 if (size == 0)
115 {
95e34ef7 116 while ((count % 16) != 0)
252b5132
RH
117 {
118 vms_debug (-level, " ");
119 count++;
120 }
121 }
95e34ef7 122 if ((count % 16) == 0)
252b5132
RH
123 {
124 vms_debug (-level, " ");
125 while (lptr < ptr)
126 {
95e34ef7 127 vms_debug (-level, "%c", (*lptr < 32) ? '.' : *lptr);
252b5132
RH
128 lptr++;
129 }
130 vms_debug (-level, "\n");
131 }
132 }
95e34ef7 133 if ((count % 16) != 0)
252b5132 134 vms_debug (-level, "\n");
252b5132
RH
135}
136#endif
252b5132 137\f
0c376465
TG
138
139/* Copy sized string (string with fixed size) to new allocated area
140 size is string size (size of record) */
252b5132
RH
141
142char *
7920ce38 143_bfd_vms_save_sized_string (unsigned char *str, int size)
252b5132 144{
dc810e39 145 char *newstr = bfd_malloc ((bfd_size_type) size + 1);
252b5132
RH
146
147 if (newstr == NULL)
7920ce38 148 return NULL;
95e34ef7 149 memcpy (newstr, (char *) str, (size_t) size);
252b5132
RH
150 newstr[size] = 0;
151
152 return newstr;
153}
154
0c376465
TG
155/* Copy counted string (string with size at first byte) to new allocated area
156 ptr points to size byte on entry */
252b5132
RH
157
158char *
7920ce38 159_bfd_vms_save_counted_string (unsigned char *ptr)
252b5132
RH
160{
161 int len = *ptr++;
162
163 return _bfd_vms_save_sized_string (ptr, len);
164}
252b5132 165\f
95e34ef7 166/* Object output routines. */
252b5132 167
95e34ef7
TG
168/* Begin new record.
169 Write 2 bytes rectype and 2 bytes record length. */
252b5132
RH
170
171void
95e34ef7 172_bfd_vms_output_begin (struct vms_rec_wr *recwr, int rectype)
252b5132 173{
95e34ef7 174 vms_debug2 ((6, "_bfd_vms_output_begin (type %d)\n", rectype));
252b5132 175
95e34ef7
TG
176 /* Record must have been closed. */
177 BFD_ASSERT (recwr->size == 0);
252b5132 178
95e34ef7 179 _bfd_vms_output_short (recwr, (unsigned int) rectype);
252b5132 180
95e34ef7
TG
181 /* Placeholder for length. */
182 _bfd_vms_output_short (recwr, 0);
252b5132 183}
252b5132 184
95e34ef7
TG
185/* Begin new sub-record.
186 Write 2 bytes rectype, and 2 bytes record length. */
252b5132
RH
187
188void
95e34ef7 189_bfd_vms_output_begin_subrec (struct vms_rec_wr *recwr, int rectype)
252b5132 190{
95e34ef7 191 vms_debug2 ((6, "_bfd_vms_output_begin_subrec (type %d)\n", rectype));
252b5132 192
95e34ef7
TG
193 /* Subrecord must have been closed. */
194 BFD_ASSERT (recwr->subrec_offset == 0);
252b5132 195
95e34ef7
TG
196 /* Save start of subrecord offset. */
197 recwr->subrec_offset = recwr->size;
252b5132 198
95e34ef7
TG
199 /* Subrecord type. */
200 _bfd_vms_output_short (recwr, (unsigned int) rectype);
252b5132 201
7920ce38 202 /* Placeholder for length. */
95e34ef7 203 _bfd_vms_output_short (recwr, 0);
252b5132
RH
204}
205
7920ce38 206/* Set record/subrecord alignment. */
252b5132
RH
207
208void
95e34ef7 209_bfd_vms_output_alignment (struct vms_rec_wr *recwr, int alignto)
252b5132 210{
95e34ef7
TG
211 vms_debug2 ((6, "_bfd_vms_output_alignment (%d)\n", alignto));
212 recwr->align = alignto;
252b5132
RH
213}
214
95e34ef7
TG
215/* Align the size of the current record (whose length is LENGTH).
216 Warning: this obviously changes the record (and the possible subrecord)
217 length. */
252b5132 218
95e34ef7
TG
219static void
220_bfd_vms_output_align (struct vms_rec_wr *recwr, unsigned int length)
252b5132 221{
95e34ef7
TG
222 unsigned int real_size = recwr->size;
223 unsigned int aligncount;
252b5132 224
95e34ef7
TG
225 /* Pad with 0 if alignment is required. */
226 aligncount = (recwr->align - (length % recwr->align)) % recwr->align;
227 vms_debug2 ((6, "align: adding %d bytes\n", aligncount));
228 while (aligncount-- > 0)
229 recwr->buf[real_size++] = 0;
252b5132 230
95e34ef7 231 recwr->size = real_size;
252b5132
RH
232}
233
95e34ef7 234/* Ends current sub-record. Set length field. */
252b5132
RH
235
236void
95e34ef7 237_bfd_vms_output_end_subrec (struct vms_rec_wr *recwr)
252b5132 238{
95e34ef7 239 int real_size = recwr->size;
252b5132
RH
240 int length;
241
95e34ef7
TG
242 /* Subrecord must be open. */
243 BFD_ASSERT (recwr->subrec_offset != 0);
252b5132 244
95e34ef7 245 length = real_size - recwr->subrec_offset;
252b5132
RH
246
247 if (length == 0)
248 return;
252b5132 249
95e34ef7 250 _bfd_vms_output_align (recwr, length);
252b5132 251
7920ce38 252 /* Put length to buffer. */
95e34ef7
TG
253 bfd_putl16 ((bfd_vma) (recwr->size - recwr->subrec_offset),
254 recwr->buf + recwr->subrec_offset + 2);
252b5132 255
95e34ef7
TG
256 /* Close the subrecord. */
257 recwr->subrec_offset = 0;
252b5132
RH
258}
259
95e34ef7 260/* Ends current record (and write it). */
252b5132
RH
261
262void
95e34ef7 263_bfd_vms_output_end (bfd *abfd, struct vms_rec_wr *recwr)
252b5132 264{
95e34ef7 265 vms_debug2 ((6, "_bfd_vms_output_end (size %u)\n", recwr->size));
252b5132 266
95e34ef7
TG
267 /* Subrecord must have been closed. */
268 BFD_ASSERT (recwr->subrec_offset == 0);
252b5132 269
95e34ef7
TG
270 if (recwr->size == 0)
271 return;
252b5132 272
95e34ef7
TG
273 _bfd_vms_output_align (recwr, recwr->size);
274
275 /* Write the length word. */
276 bfd_putl16 ((bfd_vma) recwr->size, recwr->buf + 2);
277
278 /* File is open in undefined (UDF) format on VMS, but ultimately will be
279 converted to variable length (VAR) format. VAR format has a length
280 word first which must be explicitly output in UDF format. */
281 /* So, first the length word. */
282 bfd_bwrite (recwr->buf + 2, 2, abfd);
283
284 /* Align. */
285 if (recwr->size & 1)
286 recwr->buf[recwr->size++] = 0;
287
288 /* Then the record. */
289 bfd_bwrite (recwr->buf, (size_t) recwr->size, abfd);
290
291 recwr->size = 0;
292}
293
294/* Check remaining buffer size. Return what's left. */
252b5132
RH
295
296int
95e34ef7 297_bfd_vms_output_check (struct vms_rec_wr *recwr, int size)
252b5132 298{
95e34ef7 299 vms_debug2 ((6, "_bfd_vms_output_check (%d)\n", size));
252b5132 300
95e34ef7 301 return (MAX_OUTREC_SIZE - (recwr->size + size + MIN_OUTREC_LUFT));
252b5132
RH
302}
303
7920ce38 304/* Output byte (8 bit) value. */
252b5132
RH
305
306void
95e34ef7 307_bfd_vms_output_byte (struct vms_rec_wr *recwr, unsigned int value)
252b5132 308{
95e34ef7 309 vms_debug2 ((6, "_bfd_vms_output_byte (%02x)\n", value));
252b5132 310
95e34ef7
TG
311 *(recwr->buf + recwr->size) = value;
312 recwr->size += 1;
252b5132
RH
313}
314
7920ce38 315/* Output short (16 bit) value. */
252b5132
RH
316
317void
95e34ef7 318_bfd_vms_output_short (struct vms_rec_wr *recwr, unsigned int value)
252b5132 319{
95e34ef7 320 vms_debug2 ((6, "_bfd_vms_output_short (%04x)\n", value));
252b5132 321
95e34ef7
TG
322 bfd_putl16 ((bfd_vma) value & 0xffff, recwr->buf + recwr->size);
323 recwr->size += 2;
252b5132
RH
324}
325
7920ce38 326/* Output long (32 bit) value. */
252b5132
RH
327
328void
95e34ef7 329_bfd_vms_output_long (struct vms_rec_wr *recwr, unsigned long value)
252b5132 330{
95e34ef7 331 vms_debug2 ((6, "_bfd_vms_output_long (%08lx)\n", value));
252b5132 332
95e34ef7
TG
333 bfd_putl32 ((bfd_vma) value, recwr->buf + recwr->size);
334 recwr->size += 4;
252b5132
RH
335}
336
7920ce38 337/* Output quad (64 bit) value. */
252b5132
RH
338
339void
95e34ef7 340_bfd_vms_output_quad (struct vms_rec_wr *recwr, bfd_vma value)
252b5132 341{
95e34ef7 342 vms_debug2 ((6, "_bfd_vms_output_quad (%08lx)\n", (unsigned long)value));
252b5132 343
95e34ef7
TG
344 bfd_putl64 (value, recwr->buf + recwr->size);
345 recwr->size += 8;
252b5132
RH
346}
347
7920ce38 348/* Output c-string as counted string. */
252b5132
RH
349
350void
81bb31c0 351_bfd_vms_output_counted (struct vms_rec_wr *recwr, const char *value)
252b5132 352{
7920ce38 353 int len;
252b5132 354
95e34ef7 355 vms_debug2 ((6, "_bfd_vms_output_counted (%s)\n", value));
252b5132
RH
356
357 len = strlen (value);
358 if (len == 0)
359 {
360 (*_bfd_error_handler) (_("_bfd_vms_output_counted called with zero bytes"));
361 return;
362 }
363 if (len > 255)
364 {
365 (*_bfd_error_handler) (_("_bfd_vms_output_counted called with too many bytes"));
366 return;
367 }
95e34ef7 368 _bfd_vms_output_byte (recwr, (unsigned int) len & 0xff);
81bb31c0 369 _bfd_vms_output_dump (recwr, (const unsigned char *)value, len);
252b5132
RH
370}
371
7920ce38 372/* Output character area. */
252b5132
RH
373
374void
81bb31c0 375_bfd_vms_output_dump (struct vms_rec_wr *recwr, const unsigned char *data, int len)
252b5132 376{
95e34ef7 377 vms_debug2 ((6, "_bfd_vms_output_dump (%d)\n", len));
252b5132 378
95e34ef7 379 if (len == 0)
252b5132
RH
380 return;
381
95e34ef7
TG
382 memcpy (recwr->buf + recwr->size, data, (size_t) len);
383 recwr->size += len;
252b5132
RH
384}
385
7920ce38 386/* Output count bytes of value. */
252b5132
RH
387
388void
95e34ef7 389_bfd_vms_output_fill (struct vms_rec_wr *recwr, int value, int count)
252b5132 390{
95e34ef7 391 vms_debug2 ((6, "_bfd_vms_output_fill (val %02x times %d)\n", value, count));
252b5132
RH
392
393 if (count == 0)
394 return;
95e34ef7
TG
395 memset (recwr->buf + recwr->size, value, (size_t) count);
396 recwr->size += count;
252b5132
RH
397}
398
95e34ef7
TG
399#ifdef VMS
400/* Convert the file to variable record length format. This is done
401 using undocumented system call sys$modify().
402 Pure VMS version. */
252b5132 403
bfea910e
TG
404static void
405vms_convert_to_var (char * vms_filename)
252b5132 406{
95e34ef7 407 struct FAB fab = cc$rms_fab;
252b5132 408
95e34ef7
TG
409 fab.fab$l_fna = vms_filename;
410 fab.fab$b_fns = strlen (vms_filename);
411 fab.fab$b_fac = FAB$M_PUT;
412 fab.fab$l_fop = FAB$M_ESC;
413 fab.fab$l_ctx = RME$C_SETRFM;
252b5132 414
95e34ef7 415 sys$open (&fab);
252b5132 416
95e34ef7 417 fab.fab$b_rfm = FAB$C_VAR;
252b5132 418
95e34ef7
TG
419 sys$modify (&fab);
420 sys$close (&fab);
252b5132
RH
421}
422
95e34ef7
TG
423static int
424vms_convert_to_var_1 (char *filename, int type)
252b5132 425{
95e34ef7
TG
426 if (type != DECC$K_FILE)
427 return FALSE;
428 vms_convert_to_var (filename);
429 return TRUE;
252b5132
RH
430}
431
95e34ef7
TG
432/* Convert the file to variable record length format. This is done
433 using undocumented system call sys$modify().
434 Unix filename version. */
252b5132 435
bfea910e
TG
436int
437_bfd_vms_convert_to_var_unix_filename (const char *unix_filename)
252b5132 438{
95e34ef7
TG
439 if (decc$to_vms (unix_filename, &vms_convert_to_var_1, 0, 1) != 1)
440 return FALSE;
441 return TRUE;
442}
443#endif /* VMS */
444
445/* Manufacture a VMS like time on a unix based system.
446 stolen from obj-vms.c. */
447
448unsigned char *
449get_vms_time_string (void)
450{
451 static unsigned char tbuf[18];
452#ifndef VMS
453 char *pnt;
454 time_t timeb;
455
456 time (& timeb);
457 pnt = ctime (&timeb);
458 pnt[3] = 0;
459 pnt[7] = 0;
460 pnt[10] = 0;
461 pnt[16] = 0;
462 pnt[24] = 0;
463 sprintf ((char *) tbuf, "%2s-%3s-%s %s",
464 pnt + 8, pnt + 4, pnt + 20, pnt + 11);
465#else
466 struct
467 {
468 int Size;
469 unsigned char *Ptr;
470 } Descriptor;
471 Descriptor.Size = 17;
472 Descriptor.Ptr = tbuf;
473 SYS$ASCTIM (0, &Descriptor, 0, 0);
474#endif /* not VMS */
475
476 vms_debug2 ((6, "vmstimestring:'%s'\n", tbuf));
477
478 return tbuf;
252b5132 479}
4b544b64
TG
480
481/* Create module name from filename (ie, extract the basename and convert it
482 in upper cases). Works on both VMS and UNIX pathes.
483 The result has to be free(). */
484
485char *
486vms_get_module_name (const char *filename, bfd_boolean upcase)
487{
488 char *fname, *fptr;
489 const char *fout;
490
491 /* Strip VMS path. */
492 fout = strrchr (filename, ']');
493 if (fout == NULL)
494 fout = strchr (filename, ':');
495 if (fout != NULL)
496 fout++;
497 else
498 fout = filename;
953b49ed 499
4b544b64
TG
500 /* Strip UNIX path. */
501 fptr = strrchr (fout, '/');
502 if (fptr != NULL)
503 fout = fptr + 1;
953b49ed 504
4b544b64
TG
505 fname = strdup (fout);
506
507 /* Strip suffix. */
508 fptr = strrchr (fname, '.');
509 if (fptr != 0)
510 *fptr = 0;
953b49ed 511
4b544b64
TG
512 /* Convert to upper case and truncate at 31 characters.
513 (VMS object file format restricts module name length to 31). */
514 fptr = fname;
515 for (fptr = fname; *fptr != 0; fptr++)
516 {
517 if (*fptr == ';' || (fptr - fname) >= 31)
518 {
519 *fptr = 0;
520 break;
521 }
522 if (upcase)
523 *fptr = TOUPPER (*fptr);
524 }
525 return fname;
526}
527
953b49ed
TG
528/* Compared to usual UNIX time_t, VMS time has less limits:
529 - 64 bit (63 bits in fact as the MSB must be 0)
530 - 100ns granularity
531 - epoch is Nov 17, 1858.
532 Here has the constants and the routines used to convert VMS from/to UNIX time.
62a35308
TG
533 The conversion routines don't assume 64 bits arithmetic.
534
535 Here we assume that the definition of time_t is the UNIX one, ie integer
536 type, expressing seconds since the epoch. */
953b49ed
TG
537
538/* UNIX time granularity for VMS, ie 1s / 100ns. */
539#define VMS_TIME_FACTOR 10000000
540
541/* Number of seconds since VMS epoch of the UNIX epoch. */
542#define VMS_TIME_OFFSET 3506716800U
543
544/* Convert a VMS time to a unix time. */
4b544b64
TG
545
546time_t
547vms_time_to_time_t (unsigned int hi, unsigned int lo)
548{
4b544b64
TG
549 unsigned int tmp;
550 unsigned int rlo;
551 int i;
62a35308 552 time_t res;
4b544b64
TG
553
554 /* First convert to seconds. */
953b49ed
TG
555 tmp = hi % VMS_TIME_FACTOR;
556 hi = hi / VMS_TIME_FACTOR;
4b544b64
TG
557 rlo = 0;
558 for (i = 0; i < 4; i++)
559 {
560 tmp = (tmp << 8) | (lo >> 24);
561 lo <<= 8;
562
953b49ed
TG
563 rlo = (rlo << 8) | (tmp / VMS_TIME_FACTOR);
564 tmp %= VMS_TIME_FACTOR;
4b544b64
TG
565 }
566 lo = rlo;
567
568 /* Return 0 in case of overflow. */
62a35308
TG
569 if (hi > 1
570 || (hi == 1 && lo >= VMS_TIME_OFFSET))
953b49ed
TG
571 return 0;
572
573 /* Return 0 in case of underflow. */
62a35308 574 if (hi == 0 && lo < VMS_TIME_OFFSET)
4b544b64
TG
575 return 0;
576
62a35308
TG
577 res = lo - VMS_TIME_OFFSET;
578 if (res <= 0)
579 return 0;
580 return res;
953b49ed
TG
581}
582
583/* Convert a time_t to a VMS time. */
584
585void
586vms_time_t_to_vms_time (time_t ut, unsigned int *hi, unsigned int *lo)
587{
588 unsigned short val[4];
589 unsigned short tmp[4];
590 unsigned int carry;
591 int i;
592
593 /* Put into val. */
594 val[0] = ut & 0xffff;
595 val[1] = (ut >> 16) & 0xffff;
81c5c866
JK
596 val[2] = sizeof (ut) > 4 ? (ut >> 32) & 0xffff : 0;
597 val[3] = sizeof (ut) > 4 ? (ut >> 48) & 0xffff : 0;
953b49ed
TG
598
599 /* Add offset. */
600 tmp[0] = VMS_TIME_OFFSET & 0xffff;
601 tmp[1] = VMS_TIME_OFFSET >> 16;
602 tmp[2] = 0;
603 tmp[3] = 0;
604 carry = 0;
605 for (i = 0; i < 4; i++)
606 {
607 carry += tmp[i] + val[i];
608 val[i] = carry & 0xffff;
609 carry = carry >> 16;
610 }
611
612 /* Multiply by factor, well first by 10000 and then by 1000. */
613 carry = 0;
614 for (i = 0; i < 4; i++)
615 {
616 carry += val[i] * 10000;
617 val[i] = carry & 0xffff;
618 carry = carry >> 16;
619 }
620 carry = 0;
621 for (i = 0; i < 4; i++)
622 {
623 carry += val[i] * 1000;
624 val[i] = carry & 0xffff;
625 carry = carry >> 16;
626 }
627
628 /* Write the result. */
629 *lo = val[0] | (val[1] << 16);
630 *hi = val[2] | (val[3] << 16);
4b544b64
TG
631}
632
633/* Convert a raw (stored in a buffer) VMS time to a unix time. */
634
635time_t
636vms_rawtime_to_time_t (unsigned char *buf)
637{
638 unsigned int hi = bfd_getl32 (buf + 4);
639 unsigned int lo = bfd_getl32 (buf + 0);
640
641 return vms_time_to_time_t (hi, lo);
642}
953b49ed
TG
643
644void
645vms_get_time (unsigned int *hi, unsigned int *lo)
646{
647#ifdef VMS
648 struct _generic_64 t;
649
650 sys$gettim (&t);
651 *lo = t.gen64$q_quadword;
652 *hi = t.gen64$q_quadword >> 32;
653#else
654 time_t t;
655
656 time (&t);
657 vms_time_t_to_vms_time (t, hi, lo);
658#endif
659}
660
661/* Get the current time into a raw buffer BUF. */
662
663void
664vms_raw_get_time (unsigned char *buf)
665{
666 unsigned int hi, lo;
667
668 vms_get_time (&hi, &lo);
669 bfd_putl32 (lo, buf + 0);
670 bfd_putl32 (hi, buf + 4);
671}
This page took 0.759636 seconds and 4 git commands to generate.