aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/adaint.c
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2011-09-01 15:37:13 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2011-09-01 15:37:13 +0200
commita95be2d47a4e851e44f04765e549e34c43b2f006 (patch)
tree0cab798504c4c4ee81d319ed963cb6d2ece5bc48 /gcc/ada/adaint.c
parent6b81741c0717e0322b61591a655dc83265f84ea8 (diff)
downloadgcc-a95be2d47a4e851e44f04765e549e34c43b2f006.zip
gcc-a95be2d47a4e851e44f04765e549e34c43b2f006.tar.gz
gcc-a95be2d47a4e851e44f04765e549e34c43b2f006.tar.bz2
[multiple changes]
2011-09-01 Vincent Celier <celier@adacore.com> * ug_words: Add /MULTI_UNIT_INDEX= -> -gnateI * vms_data.ads: Add new VMS qualifier equivalent for -gnateInnn 2011-09-01 Nicolas Roche <roche@adacore.com> * adaint.c (__gnat_tmp_name): Don't use tmpnam function from the system on VxWorks in kernel mode. From-SVN: r178415
Diffstat (limited to 'gcc/ada/adaint.c')
-rw-r--r--gcc/ada/adaint.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
index 26c6289..adc702a 100644
--- a/gcc/ada/adaint.c
+++ b/gcc/ada/adaint.c
@@ -1240,6 +1240,23 @@ __gnat_tmp_name (char *tmp_filename)
sprintf (tmp_filename, "%s/gnat-XXXXXX", tmpdir);
close (mkstemp(tmp_filename));
+#elif defined (__vxworks) && !(defined (__RTP__) || defined (VTHREADS))
+ int index;
+ char * pos;
+ ushort_t t;
+ static ushort_t seed = 0; /* used to generate unique name */
+
+ /* generate unique name */
+ strcpy (tmp_filename, "tmp");
+
+ /* fill up the name buffer from the last position */
+ index = 5;
+ pos = tmp_filename + strlen (tmp_filename) + index;
+ *pos = '\0';
+
+ seed++;
+ for (t = seed; 0 <= --index; t >>= 3)
+ *--pos = '0' + (t & 07);
#else
tmpnam (tmp_filename);
#endif